[PATCH] md/bitmap.c:bitmap_mask_state(): fix inconsequent NULL checking
authorAdrian Bunk <bunk@stusta.de>
Sat, 25 Mar 2006 11:07:51 +0000 (03:07 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 25 Mar 2006 16:22:57 +0000 (08:22 -0800)
We dereference bitmap both one line above and one line below this check
rendering this check quite useless.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/bitmap.c

index eae4473eadde2a359a7e00e05b8bf4a5387140cc..670eb01a5a236cf7e35e35387b1448c36211c126 100644 (file)
@@ -556,7 +556,7 @@ static void bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
        unsigned long flags;
 
        spin_lock_irqsave(&bitmap->lock, flags);
-       if (!bitmap || !bitmap->sb_page) { /* can't set the state */
+       if (!bitmap->sb_page) { /* can't set the state */
                spin_unlock_irqrestore(&bitmap->lock, flags);
                return;
        }