V4L/DVB: drivers/media/video: avoid NULL dereference
authorJulia Lawall <julia@diku.dk>
Tue, 6 Apr 2010 05:51:04 +0000 (02:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:56:42 +0000 (12:56 -0300)
commite20144770f5a119516f93959eca9818fa5ff065e
tree491a1b12736c1659a278517df77a38f33779bee8
parentd49f7a240575937703f04d07cf41be1672ce2e25
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: Julia Lawall <julia@diku.dk>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/ov511.c