mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SCSI: Make megaraid_ioctl() check copy_to_user() return value
@ 2006-09-15 12:43 Jesper Juhl
  0 siblings, 0 replies; 2+ messages in thread
From: Jesper Juhl @ 2006-09-15 12:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Seokmann Ju, Neela Syam Kolli, linux-scsi, akpm, James.Bottomley,
	jesper.juhl


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>
---

 drivers/scsi/megaraid.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-2.6.18-rc7-git1-orig/drivers/scsi/megaraid.c	2006-09-15 13:51:15.121774000 +0200
+++ linux-2.6.18-rc7-git1/drivers/scsi/megaraid.c	2006-09-15 14:27:32.377407763 +0200
@@ -3658,8 +3658,9 @@ megadev_ioctl(struct inode *inode, struc
 			 * 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 ) {




^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] SCSI: Make megaraid_ioctl() check copy_to_user() return value
@ 2006-09-15 18:26 Ju, Seokmann
  0 siblings, 0 replies; 2+ messages in thread
From: Ju, Seokmann @ 2006-09-15 18:26 UTC (permalink / raw)
  To: Jesper Juhl, linux-kernel; +Cc: Kolli, Neela, linux-scsi, akpm, James.Bottomley

Hi,

On Friday, September 15, 2006 8:43 AM, Jesper Juhl wrote:
> 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
ACK - Thank you for correction, Jesper. 

Seokmann

> -----Original Message-----
> From: Jesper Juhl [mailto:jesper.juhl@gmail.com] 
> Sent: Friday, September 15, 2006 8:43 AM
> To: linux-kernel@vger.kernel.org
> Cc: Ju, Seokmann; Kolli, Neela; linux-scsi@vger.kernel.org; 
> akpm@osdl.org; James.Bottomley@steeleye.com; jesper.juhl@gmail.com
> Subject: [PATCH] SCSI: Make megaraid_ioctl() check 
> copy_to_user() return value
> 
> 
> 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>
> ---
> 
>  drivers/scsi/megaraid.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.18-rc7-git1-orig/drivers/scsi/megaraid.c	
> 2006-09-15 13:51:15.121774000 +0200
> +++ linux-2.6.18-rc7-git1/drivers/scsi/megaraid.c	
> 2006-09-15 14:27:32.377407763 +0200
> @@ -3658,8 +3658,9 @@ megadev_ioctl(struct inode *inode, struc
>  			 * 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 ) {
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-15 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-15 12:43 [PATCH] SCSI: Make megaraid_ioctl() check copy_to_user() return value Jesper Juhl
2006-09-15 18:26 Ju, Seokmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome