aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-11-18 16:02:44 -0500
committerJens Axboe <axboe@suse.de>2005-11-18 16:02:44 -0500
commit15534d3803993345d8db32246ec329d8f83502e1 (patch)
treec486ab074dffc2cb2af56299e3d558bf7afa9e20 /drivers
parent7f0d50391adf371a0e66da0a1a44ba5cc6744ee8 (diff)
[PATCH 2/3] 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>
Diffstat (limited to 'drivers')
-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 e239a6c29230..33f8341887d0 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1017,10 +1017,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
1017 status = -ENOMEM; 1017 status = -ENOMEM;
1018 goto cleanup1; 1018 goto cleanup1;
1019 } 1019 }
1020 if (ioc->Request.Type.Direction == XFER_WRITE && 1020 if (ioc->Request.Type.Direction == XFER_WRITE) {
1021 copy_from_user(buff[sg_used], data_ptr, sz)) { 1021 if (copy_from_user(buff[sg_used], data_ptr, sz)) {
1022 status = -ENOMEM; 1022 status = -ENOMEM;
1023 goto cleanup1; 1023 goto cleanup1;
1024 }
1024 } else { 1025 } else {
1025 memset(buff[sg_used], 0, sz); 1026 memset(buff[sg_used], 0, sz);
1026 } 1027 }