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

[media] drivers/media/video/atmel-isi.c: eliminate a null pointer dereference

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0d37d350
...@@ -1036,7 +1036,7 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev) ...@@ -1036,7 +1036,7 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
err_alloc_descriptors: err_alloc_descriptors:
kfree(isi); kfree(isi);
err_alloc_isi: err_alloc_isi:
clk_put(isi->pclk); clk_put(pclk);
return ret; return ret;
} }
......
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