OSDN Git Service

OMAP: PM: SmartReflex: Add missing IS_ERR test
authorJulia Lawall <julia@diku.dk>
Mon, 24 Jan 2011 19:55:22 +0000 (20:55 +0100)
committerKevin Hilman <khilman@ti.com>
Tue, 25 Jan 2011 01:03:43 +0000 (17:03 -0800)
commit28693ec01d0229b9e2a2ebe38ef8faa5e151b440
treeaba42561a1864c31615a476a3e993d08606a5fb7
parent1bae4ce27c9c90344f23c65ea6966c50ffeae2f5
OMAP: PM: SmartReflex: Add missing IS_ERR test

Function _sr_lookup, defined in the same file, returns ERR_PTR not NULL in
an error case.

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

// <smpl>
@r@
identifier f;
@@
f(...) { ... return ERR_PTR(...); }

@@
identifier r.f, fld;
expression x;
statement S1,S2;
@@
 x = f(...)
 ... when != IS_ERR(x)
(
 if (IS_ERR(x) ||...) S1 else S2
|
*x->fld
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/smartreflex.c