From: Adrian Bunk Date: Sat, 25 Mar 2006 11:07:51 +0000 (-0800) Subject: [PATCH] md/bitmap.c:bitmap_mask_state(): fix inconsequent NULL checking X-Git-Tag: firefly_0821_release~37206 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7e3176555003a45318010d9820eb5ad1abb596bf;p=firefly-linux-kernel-4.4.55.git [PATCH] md/bitmap.c:bitmap_mask_state(): fix inconsequent NULL checking 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 Cc: Alasdair G Kergon Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index eae4473eadde..670eb01a5a23 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -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; }