Skip to content

Commit

Permalink
[media] drivers/media/video/atmel-isi.c: eliminate a null pointer der…
Browse files Browse the repository at this point in the history
…eference

The variable isi might be null or might be freed at the point of the call
to clk_put.  pclk contains the value that isi->pclk is expected to point to.

The semantic match that finds this problem is as follows:

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

if (E == NULL)
{
  ... when != if (E == NULL || ...) 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>
  • Loading branch information
Julia Lawall authored and Mauro Carvalho Chehab committed Nov 7, 2011
1 parent 0d37d35 commit 0a4524d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/atmel-isi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
err_alloc_descriptors:
kfree(isi);
err_alloc_isi:
clk_put(isi->pclk);
clk_put(pclk);

return ret;
}
Expand Down

0 comments on commit 0a4524d

Please sign in to comment.