From: "Stephen Biggs" <yrgrknmxpzlk@gawab.com>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH][19/26] drivers/video/kyro/* - compile warning cleanup
Date: Thu, 10 Feb 2005 21:34:28 +0000 [thread overview]
Message-ID: <420BEF84.32422.5872E2@localhost> (raw)
[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 2213 bytes --]
Description: compile warning cleanup - handle copy_to/from_user error
returns
Signed-off-by: Stephen Biggs <yrgrknmxpzlk@gawab.com>
diff -Nurdp -X dontdiff-osdl linux-2.6.11-rc3-mm-original/drivers/video/kyro/fbdev.c linux-2.6.11-rc3-mm/drivers/video/kyro/fbdev.c
--- linux-2.6.11-rc3-mm-original/drivers/video/kyro/fbdev.c 2005-02-07 16:32:21.000000000 +0200
+++ linux-2.6.11-rc3-mm/drivers/video/kyro/fbdev.c 2005-02-08 18:40:40.000000000 +0200
@@ -596,7 +596,10 @@ 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))) {
+ printk(KERN_ERR "copy_from_user failed!\n");
+ return -EFAULT;
+ }
if (kyro_dev_overlay_create(ol_create.ulWidth,
ol_create.ulHeight, 0) < 0) {
@@ -606,8 +609,11 @@ 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))) {
+ printk(KERN_ERR "copy_from_user failed!\n");
+ return -EFAULT;
+ }
if (kyro_dev_overlay_viewport_set(ol_viewport_set.xOrgin,
ol_viewport_set.yOrgin,
@@ -627,13 +633,22 @@ 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))) {
+ printk(KERN_ERR "copy_to_user failed!\n");
+ 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))) {
+ printk(KERN_ERR "copy_to_user failed!\n");
+ 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))) {
+ printk(KERN_ERR "copy_to_user failed!\n");
+ return -EFAULT;
+ }
break;
}
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next reply other threads:[~2005-02-10 21:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-10 21:34 Stephen Biggs [this message]
2005-02-11 6:20 ` [KJ] [PATCH][19/26] drivers/video/kyro/* - compile warning cleanup Alexey Dobriyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=420BEF84.32422.5872E2@localhost \
--to=yrgrknmxpzlk@gawab.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.