[SCSI] megaraid: Make megaraid_ioctl() check copy_to_user() return value
authorJesper Juhl <jesper.juhl@gmail.com>
Fri, 15 Sep 2006 12:43:11 +0000 (14:43 +0200)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sat, 23 Sep 2006 16:53:09 +0000 (11:53 -0500)
Check copy_to_user() return value in drivers/scsi/megaraid.c::megadev_ioctl()
This gets rid of this little warning:
  drivers/scsi/megaraid.c:3661: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: "Ju, Seokmann" <Seokmann.Ju@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/megaraid.c

index ccb0055ac73add3ed031491eae3d57f487b232a3..b87bef69ba0fc28b9261350cae27795df3b72f9c 100644 (file)
@@ -3656,8 +3656,9 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
                         * Send the request sense data also, irrespective of
                         * whether the user has asked for it or not.
                         */
-                       copy_to_user(upthru->reqsensearea,
-                                       pthru->reqsensearea, 14);
+                       if (copy_to_user(upthru->reqsensearea,
+                                       pthru->reqsensearea, 14))
+                               rval = -EFAULT;
 
 freemem_and_return:
                        if( pthru->dataxferlen ) {