ide: Remove unneeded null pointer check
authorStefan Weil <weil@mail.berlios.de>
Sat, 15 Jan 2011 18:01:03 +0000 (19:01 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 24 Jan 2011 15:41:49 +0000 (16:41 +0100)
With bm == NULL, other code in the same function would crash.

This bug was reported by cppcheck:
hw/ide/pci.c:280: error: Possible null pointer dereference: bm

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/pci.c

index 987caffa3a70e29f919226bd531fb0e5d2ed676e..35168cb46970f70b904390637bc6d9cbd75155fb 100644 (file)
@@ -267,9 +267,7 @@ static void bmdma_irq(void *opaque, int n, int level)
         return;
     }
 
-    if (bm) {
-        bm->status |= BM_STATUS_INT;
-    }
+    bm->status |= BM_STATUS_INT;
 
     /* trigger the real irq */
     qemu_set_irq(bm->irq, level);