From: Hans Verkuil Date: Mon, 11 Nov 2013 11:16:03 +0000 (-0300) Subject: media: bttv: don't setup the controls if there are no video devices X-Git-Tag: v3.10.25~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=899901b0776c94e91742f7f3e14ad39bc6e44411;p=platform%2Fkernel%2Flinux-stable.git media: bttv: don't setup the controls if there are no video devices commit f8e1b699a5504a2da05834c7cfdddb125a8ce088 upstream. The no_video flag was checked in all other cases except one. Calling v4l2_ctrl_handler_setup() if no_video is 1 will crash. This wasn't noticed before since there are only two card types that set no_video to 1, so this type of hardware is quite rare. Signed-off-by: Hans Verkuil Reported-by: Lorenz Röhrl Tested-by: Lorenz Röhrl Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index e7d0884..e2633d9 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -4226,7 +4226,8 @@ static int bttv_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) } btv->std = V4L2_STD_PAL; init_irqreg(btv); - v4l2_ctrl_handler_setup(hdl); + if (!bttv_tvcards[btv->c.type].no_video) + v4l2_ctrl_handler_setup(hdl); if (hdl->error) { result = hdl->error; goto fail2;