summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-11-18 14:02:54 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-12-14 15:43:00 -0800
commit1a6e1022c1f5cc1ae2efb73ff2b4daf5eec5819f (patch)
treece85cb18ce2dc4e0b1ed070b90e5ef8054c98cd8
parent1023cf6f2fe71367b6855e24e2dd4668bd00ad3c (diff)
downloadlinux-stable-1a6e1022c1f5cc1ae2efb73ff2b4daf5eec5819f.tar.gz
linux-stable-1a6e1022c1f5cc1ae2efb73ff2b4daf5eec5819f.tar.bz2
linux-stable-1a6e1022c1f5cc1ae2efb73ff2b4daf5eec5819f.zip
[PATCH] cciss: bug fix for BIG_PASS_THRU
Applications using CCISS_BIG_PASSTHRU complained that the data written was zeros. The problem is that the buffer is being cleared after the user copy, unless the user copy has failed... Correct that logic. Signed-off-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/block/cciss.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 486b6e1c7dfb..7bb1f1aac0e0 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1016,10 +1016,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
status = -ENOMEM;
goto cleanup1;
}
- if (ioc->Request.Type.Direction == XFER_WRITE &&
- copy_from_user(buff[sg_used], data_ptr, sz)) {
+ if (ioc->Request.Type.Direction == XFER_WRITE) {
+ if (copy_from_user(buff[sg_used], data_ptr, sz)) {
status = -ENOMEM;
- goto cleanup1;
+ goto cleanup1;
+ }
} else {
memset(buff[sg_used], 0, sz);
}