linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][resend] drivers/video/kyro/fbdev.c ignoring return value of copy_*_user
@ 2005-03-04 14:26 Jesper Juhl
  2005-03-04 17:32 ` [Linux-fbdev-devel] " Antonino A. Daplas
  0 siblings, 1 reply; 3+ messages in thread
From: Jesper Juhl @ 2005-03-04 14:26 UTC (permalink / raw)
  To: Paul Mundt; +Cc: linux-fbdev-devel, LKML


Hi, 

2.6.11 still contain these warnings :

drivers/video/kyro/fbdev.c:597: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
drivers/video/kyro/fbdev.c:607: warning: ignoring return value of `copy_from_user', declared with attribute warn_unused_result
drivers/video/kyro/fbdev.c:628: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result
drivers/video/kyro/fbdev.c:631: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result
drivers/video/kyro/fbdev.c:634: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

Here's a patch that has been send before but obviously didn't make it in. 
re-diff'ed against 2.6.11


Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

--- linux-2.6.11-orig/drivers/video/kyro/fbdev.c	2005-03-02 08:37:31.000000000 +0100
+++ linux-2.6.11/drivers/video/kyro/fbdev.c	2005-03-04 15:12:54.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/video/kyro/kyrofb.c
+ *  linux/drivers/video/kyro/fbdev.c
  *
  *  Copyright (C) 2002 STMicroelectronics
  *  Copyright (C) 2003, 2004 Paul Mundt
@@ -594,7 +594,8 @@ static int kyrofb_ioctl(struct inode *in
 
 	switch (cmd) {
 	case KYRO_IOCTL_OVERLAY_CREATE:
-		copy_from_user(&ol_create, argp, sizeof(overlay_create));
+		if (copy_from_user(&ol_create, argp, sizeof(overlay_create)))
+			return -EFAULT;
 
 		if (kyro_dev_overlay_create(ol_create.ulWidth,
 					    ol_create.ulHeight, 0) < 0) {
@@ -604,8 +605,9 @@ static int kyrofb_ioctl(struct inode *in
 		}
 		break;
 	case KYRO_IOCTL_OVERLAY_VIEWPORT_SET:
-		copy_from_user(&ol_viewport_set, argp,
-			       sizeof(overlay_viewport_set));
+		if (copy_from_user(&ol_viewport_set, argp,
+			       sizeof(overlay_viewport_set)))
+			return -EFAULT;
 
 		if (kyro_dev_overlay_viewport_set(ol_viewport_set.xOrgin,
 						  ol_viewport_set.yOrgin,
@@ -625,13 +627,16 @@ static int kyrofb_ioctl(struct inode *in
 		}
 		break;
 	case KYRO_IOCTL_UVSTRIDE:
-		copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(unsigned long));
+		if (copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(unsigned long)))
+			return -EFAULT;
 		break;
 	case KYRO_IOCTL_STRIDE:
-		copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(unsigned long));
+		if (copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(unsigned long)))
+			return -EFAULT;
 		break;
 	case KYRO_IOCTL_OVERLAY_OFFSET:
-		copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(unsigned long));
+		if (copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(unsigned long)))
+			return -EFAULT;
 		break;
 	}
 



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

* Re: [Linux-fbdev-devel] [PATCH][resend] drivers/video/kyro/fbdev.c ignoring return value of copy_*_user
  2005-03-04 14:26 [PATCH][resend] drivers/video/kyro/fbdev.c ignoring return value of copy_*_user Jesper Juhl
@ 2005-03-04 17:32 ` Antonino A. Daplas
  2005-03-04 20:27   ` Jesper Juhl
  0 siblings, 1 reply; 3+ messages in thread
From: Antonino A. Daplas @ 2005-03-04 17:32 UTC (permalink / raw)
  To: linux-fbdev-devel, Jesper Juhl, Paul Mundt; +Cc: linux-fbdev-devel, LKML

On Friday 04 March 2005 22:26, Jesper Juhl wrote:
> Hi,
>
> 2.6.11 still contain these warnings :
>
> drivers/video/kyro/fbdev.c:597: warning: ignoring return value of
> `copy_from_user', declared with attribute warn_unused_result
> drivers/video/kyro/fbdev.c:607: warning: ignoring return value of
> `copy_from_user', declared with attribute warn_unused_result
> drivers/video/kyro/fbdev.c:628: warning: ignoring return value of
> `copy_to_user', declared with attribute warn_unused_result
> drivers/video/kyro/fbdev.c:631: warning: ignoring return value of
> `copy_to_user', declared with attribute warn_unused_result
> drivers/video/kyro/fbdev.c:634: warning: ignoring return value of
> `copy_to_user', declared with attribute warn_unused_result
>
> Here's a patch that has been send before but obviously didn't make it in.
> re-diff'ed against 2.6.11

Your patch is already in the mm tree along with the other fbdev patches.

Tony



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

* Re: [Linux-fbdev-devel] [PATCH][resend] drivers/video/kyro/fbdev.c ignoring return value of copy_*_user
  2005-03-04 17:32 ` [Linux-fbdev-devel] " Antonino A. Daplas
@ 2005-03-04 20:27   ` Jesper Juhl
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Juhl @ 2005-03-04 20:27 UTC (permalink / raw)
  To: adaplas; +Cc: linux-fbdev-devel, Paul Mundt, LKML

On Sat, 5 Mar 2005, Antonino A. Daplas wrote:

> On Friday 04 March 2005 22:26, Jesper Juhl wrote:
> > Hi,
> >
> > 2.6.11 still contain these warnings :
> >
> > drivers/video/kyro/fbdev.c:597: warning: ignoring return value of
> > `copy_from_user', declared with attribute warn_unused_result
> > drivers/video/kyro/fbdev.c:607: warning: ignoring return value of
> > `copy_from_user', declared with attribute warn_unused_result
> > drivers/video/kyro/fbdev.c:628: warning: ignoring return value of
> > `copy_to_user', declared with attribute warn_unused_result
> > drivers/video/kyro/fbdev.c:631: warning: ignoring return value of
> > `copy_to_user', declared with attribute warn_unused_result
> > drivers/video/kyro/fbdev.c:634: warning: ignoring return value of
> > `copy_to_user', declared with attribute warn_unused_result
> >
> > Here's a patch that has been send before but obviously didn't make it in.
> > re-diff'ed against 2.6.11
> 
> Your patch is already in the mm tree along with the other fbdev patches.
> 
Yeah, I'm an idiot, I had forgotten about that. Sorry for the noice.

-- 
Jesper



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

end of thread, other threads:[~2005-03-04 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-04 14:26 [PATCH][resend] drivers/video/kyro/fbdev.c ignoring return value of copy_*_user Jesper Juhl
2005-03-04 17:32 ` [Linux-fbdev-devel] " Antonino A. Daplas
2005-03-04 20:27   ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).