[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.2 / 0109-cx23885-dvb-check-if-dvb_attach-succeded.patch
1 From eba71ad513d0aaab1592c2a0f96689fb99e84358 Mon Sep 17 00:00:00 2001
2 From: Miroslav Slugen <thunder.mmm@gmail.com>
3 Date: Sun, 11 Dec 2011 18:57:58 -0300
4 Subject: [PATCH 109/130] cx23885-dvb: check if dvb_attach() succeded
6 commit a7c8aadad39428b64d26c3971d967f8314e2397d upstream.
8 Fix possible null dereference for Leadtek DTV 3200H
9 XC4000 tuner when no firmware file available.
11 Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com>
12 Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 ---
15 drivers/media/video/cx23885/cx23885-dvb.c | 5 +++++
16 1 file changed, 5 insertions(+)
18 diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
19 index bcb45be..f0482b2 100644
20 --- a/drivers/media/video/cx23885/cx23885-dvb.c
21 +++ b/drivers/media/video/cx23885/cx23885-dvb.c
22 @@ -940,6 +940,11 @@ static int dvb_register(struct cx23885_tsport *port)
24 fe = dvb_attach(xc4000_attach, fe0->dvb.frontend,
25 &dev->i2c_bus[1].i2c_adap, &cfg);
26 + if (!fe) {
27 + printk(KERN_ERR "%s/2: xc4000 attach failed\n",
28 + dev->name);
29 + goto frontend_detach;
30 + }
31 }
32 break;
33 case CX23885_BOARD_TBS_6920:
34 --
35 1.7.9.4