Commit e2014477 authored by Julia Lawall's avatar Julia Lawall Committed by Mauro Carvalho Chehab

V4L/DVB: drivers/media/video: avoid NULL dereference

It seems impossible for ov to be NULL at this point.

The semantic match that finds the problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E, E1;
identifier f;
statement S1,S3;
iterator iter;
@@

if ((E == NULL && ...) || ...)
{
  ... when != false ((E == NULL && ...) || ...)
      when != true  ((E != NULL && ...) || ...)
      when != iter(E,...) S1
      when != E = E1
(
  sizeof(E->f)
|
* E->f
)
  ... when any
  return ...;
}
else S3
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d49f7a24
...@@ -5916,11 +5916,6 @@ ov51x_disconnect(struct usb_interface *intf) ...@@ -5916,11 +5916,6 @@ ov51x_disconnect(struct usb_interface *intf)
mutex_lock(&ov->lock); mutex_lock(&ov->lock);
usb_set_intfdata (intf, NULL); usb_set_intfdata (intf, NULL);
if (!ov) {
mutex_unlock(&ov->lock);
return;
}
/* Free device number */ /* Free device number */
ov511_devused &= ~(1 << ov->nr); ov511_devused &= ~(1 << ov->nr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment