ataflop: adjust NULL test
authorJulia Lawall <julia@diku.dk>
Mon, 13 Jul 2009 20:43:41 +0000 (22:43 +0200)
committerTejun Heo <tj@kernel.org>
Fri, 17 Jul 2009 06:29:58 +0000 (15:29 +0900)
commit8f47428704c2fd6f787a6f340071b9c338b65803
tree15318bc754cabdda0752ae69193415e5868a5674
parent0a09f4319c6d88c732ed46735f8584bbb95cac65
ataflop: adjust NULL test

dtp is derefenced on the lines above the test !dtp, and so it cannot be
NULL at this point.

A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r@
expression x,E,E1;
identifier f,l;
position p1,p2;
@@

*x@p1->f = E1;
... when != x = E
    when != goto l;
(
*x@p2 == NULL
|
*x@p2 != NULL
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/block/ataflop.c