diff options
author | 2005-11-18 22:02:44 +0100 | |
---|---|---|
committer | 2005-11-18 22:02:44 +0100 | |
commit | 15534d3803993345d8db32246ec329d8f83502e1 (patch) | |
tree | c486ab074dffc2cb2af56299e3d558bf7afa9e20 | |
parent | [PATCH 1/3] cciss: bug fix for hpacucli (diff) | |
download | linux-15534d3803993345d8db32246ec329d8f83502e1.tar.gz linux-15534d3803993345d8db32246ec329d8f83502e1.tar.bz2 linux-15534d3803993345d8db32246ec329d8f83502e1.zip |
[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>
-rw-r--r-- | drivers/block/cciss.c | 7 |
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, 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); } |