Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15534d38 authored by Jens Axboe's avatar Jens Axboe
Browse files

[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: default avatarMike Miller <mike.miller@hp.com>
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
parent 7f0d5039
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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;
				}
			} else {
				memset(buff[sg_used], 0, sz);
			}