mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
[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>
This commit is contained in:
parent
1023cf6f2f
commit
1a6e1022c1
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue