]> bbs.cooldavid.org Git - net-next-2.6.git/commit
arch/sparc/kernel: Eliminate what looks like a NULL pointer dereference
authorJulia Lawall <julia@diku.dk>
Fri, 4 Jun 2010 23:17:37 +0000 (16:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Jun 2010 23:17:37 +0000 (16:17 -0700)
commit0d0659c78d7ea29ad6c3c538dcaae0227f31b9d2
tree4383a16168096e94919c980a2cbcd7a5e81c6492
parent0fc251d9a6c9fb841b73f29dd73dcf91afe7883f
arch/sparc/kernel: Eliminate what looks like a NULL pointer dereference

At the point of the test, action cannot be NULL, as it has been dereferenced
in the code just above.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

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

if ((E == NULL && ...) || ...)
{
  ... when != if (...) S1 else S2
      when != E = E1
* E->f
  ... when any
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/sun4d_irq.c