lkml.org 
[lkml]   [2001]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch] Does this correct a bug in ibmcam.c?
Date
I had problems with copy_from_user.

Please CC me as I am not on this list.
__________________________________


--- ibmcam.c.orig Fri Feb 9 14:30:23 2001
+++ ibmcam.c Mon Mar 12 02:58:57 2001
@@ -2527,16 +2527,17 @@
}
case VIDIOCSCHAN:
{
- int v;
+ int chan;

- if (copy_from_user(&v, arg, sizeof(v)))
- return -EFAULT;
- if ((v < 0) || (v >= 3)) /* 3 grades of lighting conditions */
- return -EINVAL;
- if (v != ibmcam->vchan.channel) {
- ibmcam->vchan.channel = v;
+ chan = (int)arg;
+
+ if ((chan < 0) || (chan >= 3)) /* 3 grades of lighting conditions */
+ return -EINVAL;
+
+ if (chan != ibmcam->vchan.channel) {
+ ibmcam->vchan.channel = chan;
usb_ibmcam_change_lighting_conditions(ibmcam);
- }
+ }
return 0;
}
case VIDIOCGPICT:


--
Lee Brown Jr.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:2.130 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site