summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorPeter Senna Tschudin2012-10-30 15:09:41 +0100
committerMauro Carvalho Chehab2012-12-21 20:43:22 +0100
commit37e310edf3f6090eb118b7fcafd00221c290ac6b (patch)
treea2901516ae5c37bdd130b42690b55166b9c3072a /drivers/media/pci
parent[media] media: coda: Fix H.264 header alignment - v2 (diff)
downloadkernel-qcow2-linux-37e310edf3f6090eb118b7fcafd00221c290ac6b.tar.gz
kernel-qcow2-linux-37e310edf3f6090eb118b7fcafd00221c290ac6b.tar.xz
kernel-qcow2-linux-37e310edf3f6090eb118b7fcafd00221c290ac6b.zip
[media] drivers/media/pci/saa7134/saa7134-dvb.c: Test if videobuf_dvb_get_frontend return NULL
Based on commit: e66131cee501ee720b7b58a4b87073b8fbaaaba6 Not testing videobuf_dvb_get_frontend output may cause OOPS if it return NULL. This patch fixes this issue. The semantic patch that found this issue is(http://coccinelle.lip6.fr/): // <smpl> @@ identifier i,a,b; statement S, S2; @@ i = videobuf_dvb_get_frontend(...); ... when != if (!i) S * if (i->a.b) S2 // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/saa7134/saa7134-dvb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c
index b209de40a4f8..27915e501db9 100644
--- a/drivers/media/pci/saa7134/saa7134-dvb.c
+++ b/drivers/media/pci/saa7134/saa7134-dvb.c
@@ -607,6 +607,9 @@ static int configure_tda827x_fe(struct saa7134_dev *dev,
/* Get the first frontend */
fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
+ if (!fe0)
+ return -EINVAL;
+
fe0->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap);
if (fe0->dvb.frontend) {
if (cdec_conf->i2c_gate)