Skip to content

Commit

Permalink
ide: Remove unneeded null pointer check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
Stefan Weil authored and kevmw committed Jan 24, 2011
1 parent 3de0a29 commit 1635eec
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hw/ide/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1635eec

Please sign in to comment.