pci: Remove unneeded null pointer check
PATCH 1/1 pci: Remove unneeded null pointer check
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]>
--- hw/ide/pci.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
hw/ide/pci.c +1 -3
@@ -272,9 +272,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);
Signature · 1 line
1.7.2.3
Quoted 7 lines · Stefan Weil
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: bmCc Michael S. Tsirkin <[email protected]>Signed-off-by Stefan Weil <[email protected]>
Looks sane. Kevin?
Quoted 21 lines
--- hw/ide/pci.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)hw/ide/pci.c +1
-3@@ -272,9 +272,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);Signature · 1 line
1.7.2.3
Kevin Wolf
AppliedAm 15.01.2011 19:01, schrieb Stefan Weil:
Quoted 7 lines
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: bmCc Michael S. Tsirkin <[email protected]>Signed-off-by Stefan Weil <[email protected]>
Thanks, applied to the block branch.
Kevin