Commit 1a6e1022 authored by Jens Axboe's avatar Jens Axboe Committed by Greg Kroah-Hartman

[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: default avatarMike Miller <mike.miller@hp.com>
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1023cf6f
...@@ -1016,10 +1016,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, ...@@ -1016,10 +1016,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
status = -ENOMEM; status = -ENOMEM;
goto cleanup1; goto cleanup1;
} }
if (ioc->Request.Type.Direction == XFER_WRITE && if (ioc->Request.Type.Direction == XFER_WRITE) {
copy_from_user(buff[sg_used], data_ptr, sz)) { if (copy_from_user(buff[sg_used], data_ptr, sz)) {
status = -ENOMEM; status = -ENOMEM;
goto cleanup1; goto cleanup1;
}
} else { } else {
memset(buff[sg_used], 0, sz); memset(buff[sg_used], 0, sz);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment