arch/sparc/kernel: Eliminate what looks like a NULL pointer dereference
Subsystems (2)
PATCH 3/11 arch/sparc/kernel: Eliminate what looks like a NULL pointer dereference
From: Julia Lawall <[email protected]>
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>
--- arch/sparc/kernel/sun4d_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/sun4d_irq.c +1 -1
@@ -183,7 +183,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) goto out_unlock; } -if (action && tmp) +if (tmp) tmp->next = action->next;else *actionp = action->next;
From: Julia Lawall <[email protected]>
Date: Thu, 27 May 2010 14:32:45 +0200 (CEST)
Quoted 7 lines
From: Julia Lawall <[email protected]>
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/)
...
Quoted 1 line
Signed-off-by Julia Lawall <[email protected]>
Applied, thanks Julia.