Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4202066c authored by Julia Lawall's avatar Julia Lawall Committed by Mauro Carvalho Chehab
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5c331fc8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
	num = hpsb_iso_n_ready(iso);

	if (!fdtv) {
		dev_err(fdtv->device, "received at unknown iso channel\n");
		pr_err("received at unknown iso channel\n");
		goto out;
	}

+1 −1
Original line number Diff line number Diff line
@@ -366,7 +366,7 @@ static int hdpvr_open(struct file *file)

	dev = (struct hdpvr_device *)video_get_drvdata(video_devdata(file));
	if (!dev) {
		v4l2_err(&dev->v4l2_dev, "open failing with with ENODEV\n");
		pr_err("open failing with with ENODEV\n");
		retval = -ENODEV;
		goto err;
	}
+1 −2
Original line number Diff line number Diff line
@@ -1671,8 +1671,7 @@ static void __devexit usbvision_disconnect(struct usb_interface *intf)
	PDEBUG(DBG_PROBE, "");

	if (usbvision == NULL) {
		dev_err(&usbvision->dev->dev,
			"%s: usb_get_intfdata() failed\n", __func__);
		pr_err("%s: usb_get_intfdata() failed\n", __func__);
		return;
	}