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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
14422f9dd8
commit
b8bfb5fb34
@@ -1042,13 +1042,11 @@ static int vidioc_queryctrl(struct file *file, void *priv,
|
|||||||
for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) {
|
for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) {
|
||||||
if (gspca_dev->ctrl_dis & (1 << i))
|
if (gspca_dev->ctrl_dis & (1 << i))
|
||||||
continue;
|
continue;
|
||||||
if (ctrls->qctrl.id < id)
|
if (gspca_dev->sd_desc->ctrls[i].qctrl.id < id)
|
||||||
continue;
|
continue;
|
||||||
if (ctrls != NULL) {
|
if (ctrls && gspca_dev->sd_desc->ctrls[i].qctrl.id
|
||||||
if (gspca_dev->sd_desc->ctrls[i].qctrl.id
|
|
||||||
> ctrls->qctrl.id)
|
> ctrls->qctrl.id)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
ctrls = &gspca_dev->sd_desc->ctrls[i];
|
ctrls = &gspca_dev->sd_desc->ctrls[i];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user