|
@@ -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);
|
|
|
}
|