aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-06-13 18:56:22 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-23 03:11:07 -0300
commitb8bfb5fb348d939a96fc8f71996a2e5e48b4544b (patch)
treec9e058777f5f0869166eeadd23a9f0baac037d5c
parent14422f9dd8515bfbe6fdbde37eadf59e2980f104 (diff)
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 f7e0355ad64..1e89600986c 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 {