summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-06-14 01:56:22 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-23 10:11:07 +0400
commitb8bfb5fb348d939a96fc8f71996a2e5e48b4544b (patch)
treec9e058777f5f0869166eeadd23a9f0baac037d5c
parent14422f9dd8515bfbe6fdbde37eadf59e2980f104 (diff)
downloadlinux-b8bfb5fb348d939a96fc8f71996a2e5e48b4544b.tar.xz
V4L/DVB (12071): gspca: fix NULL pointer deref in query_ctrl
gspca: fix NULL pointer deref in query_ctrl Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/gspca/gspca.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index f7e0355ad644..1e89600986c8 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -1042,13 +1042,11 @@ static int vidioc_queryctrl(struct file *file, void *priv,
for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) {
if (gspca_dev->ctrl_dis & (1 << i))
continue;
- if (ctrls->qctrl.id < id)
+ if (gspca_dev->sd_desc->ctrls[i].qctrl.id < id)
continue;
- if (ctrls != NULL) {
- if (gspca_dev->sd_desc->ctrls[i].qctrl.id
+ if (ctrls && gspca_dev->sd_desc->ctrls[i].qctrl.id
> ctrls->qctrl.id)
- continue;
- }
+ continue;
ctrls = &gspca_dev->sd_desc->ctrls[i];
}
} else {