summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-01-15 07:42:36 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-01-29 18:28:16 -0200
commitc7e5a726d5fbf453c49fc8326a6580402643c900 (patch)
tree20f0ea70ac094d4ba6f29b725bb7a4c47d0337f0
parent0f5b26576246251622e33c076486b7cb0bdb0d99 (diff)
downloadblackbird-obmc-linux-c7e5a726d5fbf453c49fc8326a6580402643c900.tar.gz
blackbird-obmc-linux-c7e5a726d5fbf453c49fc8326a6580402643c900.zip
[media] gspca: Fix underflow in vidioc_s_parm()
"n" is a user controlled integer. The code here doesn't handle the case where "n" is negative and this causes a static checker warning. drivers/media/usb/gspca/gspca.c:1571 vidioc_s_parm() warn: no lower bound on 'n' parm.capture.readbuffers is unsigned, so make n unsigned too, fixing this. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/gspca/gspca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 43d65057a5fe..e54cee856a80 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -1562,7 +1562,7 @@ static int vidioc_s_parm(struct file *filp, void *priv,
struct v4l2_streamparm *parm)
{
struct gspca_dev *gspca_dev = video_drvdata(filp);
- int n;
+ unsigned int n;
n = parm->parm.capture.readbuffers;
if (n == 0 || n >= GSPCA_MAX_FRAMES)
OpenPOWER on IntegriCloud