unction in an error case.
A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)
//
@r exists@
local idexpression x;
expression E;
identifier f1;
iterator I;
@@
x = alloc_pci_dev(...);
<... when != x
when != true (x == NULL || ...)
when != if (...) { <+...x...+> }
when != I (...) { <+...x...+> }
(
x == NULL
|
x == E
|
x->f1
)
...>
* return ...;
//
Signed-off-by: Julia Lawall
Dan Carpenter
Dave Airlie
Cc: Helge Deller
Cc: "James E.J. Bottomley"
Signed-off-by: Andrew Morton
Signed-off-by: Kyle McMartin
U