diff options
author | Julia Lawall <julia@diku.dk> | 2009-07-13 16:43:41 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-07-17 02:29:58 -0400 |
commit | 8f47428704c2fd6f787a6f340071b9c338b65803 (patch) | |
tree | 15318bc754cabdda0752ae69193415e5868a5674 /drivers/block/ataflop.c | |
parent | 0a09f4319c6d88c732ed46735f8584bbb95cac65 (diff) |
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>
Diffstat (limited to 'drivers/block/ataflop.c')
-rw-r--r-- | drivers/block/ataflop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index f5e7180d7f47..3ff02941b3dd 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c | |||
@@ -1627,7 +1627,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, | |||
1627 | drive, dtp->blocks, dtp->spt, dtp->stretch); | 1627 | drive, dtp->blocks, dtp->spt, dtp->stretch); |
1628 | 1628 | ||
1629 | /* sanity check */ | 1629 | /* sanity check */ |
1630 | if (!dtp || setprm.track != dtp->blocks/dtp->spt/2 || | 1630 | if (setprm.track != dtp->blocks/dtp->spt/2 || |
1631 | setprm.head != 2) { | 1631 | setprm.head != 2) { |
1632 | redo_fd_request(); | 1632 | redo_fd_request(); |
1633 | return -EINVAL; | 1633 | return -EINVAL; |