aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-27 08:36:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-06-01 00:24:22 -0400
commit4202066c6995200b2755a4501ea90f5d4e163e41 (patch)
tree4d1dfe0734e9992efae9c42a81f9c5c50cbcbfa0 /drivers
parent5c331fc8c19e181bffab46e9d18e1637cdc47170 (diff)
V4L/DVB: drivers/media: Eliminate a NULL pointer dereference
In each case, the print involves dereferencing a value that is NULL or is near NULL. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && ...) || ...) { ... when != if (...) S1 else S2 when != E = E1 * E->f ... when any return ...; } else S3 // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/firewire/firedtv-1394.c2
-rw-r--r--drivers/media/video/hdpvr/hdpvr-video.c2
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c3
3 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/dvb/firewire/firedtv-1394.c b/drivers/media/dvb/firewire/firedtv-1394.c
index 26333b4f4d3e..b34ca7afb0e6 100644
--- a/drivers/media/dvb/firewire/firedtv-1394.c
+++ b/drivers/media/dvb/firewire/firedtv-1394.c
@@ -58,7 +58,7 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
58 num = hpsb_iso_n_ready(iso); 58 num = hpsb_iso_n_ready(iso);
59 59
60 if (!fdtv) { 60 if (!fdtv) {
61 dev_err(fdtv->device, "received at unknown iso channel\n"); 61 pr_err("received at unknown iso channel\n");
62 goto out; 62 goto out;
63 } 63 }
64 64
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index 7cfccfd1b870..c338f3f62e77 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -366,7 +366,7 @@ static int hdpvr_open(struct file *file)
366 366
367 dev = (struct hdpvr_device *)video_get_drvdata(video_devdata(file)); 367 dev = (struct hdpvr_device *)video_get_drvdata(video_devdata(file));
368 if (!dev) { 368 if (!dev) {
369 v4l2_err(&dev->v4l2_dev, "open failing with with ENODEV\n"); 369 pr_err("open failing with with ENODEV\n");
370 retval = -ENODEV; 370 retval = -ENODEV;
371 goto err; 371 goto err;
372 } 372 }
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 6248a639ba2d..c2690df33438 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -1671,8 +1671,7 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
1671 PDEBUG(DBG_PROBE, ""); 1671 PDEBUG(DBG_PROBE, "");
1672 1672
1673 if (usbvision == NULL) { 1673 if (usbvision == NULL) {
1674 dev_err(&usbvision->dev->dev, 1674 pr_err("%s: usb_get_intfdata() failed\n", __func__);
1675 "%s: usb_get_intfdata() failed\n", __func__);
1676 return; 1675 return;
1677 } 1676 }
1678 1677