* [Qemu-devel] [PATCH] pci: Remove unneeded null pointer check
@ 2011-01-15 18:01 Stefan Weil
2011-01-15 18:11 ` [Qemu-devel] " Michael S. Tsirkin
2011-01-17 9:43 ` [Qemu-devel] " Kevin Wolf
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Weil @ 2011-01-15 18:01 UTC (permalink / raw)
To: QEMU Developers; +Cc: Michael S. Tsirkin
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>
---
hw/ide/pci.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 510b2de..f0db4f2 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -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);
--
1.7.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] Re: [PATCH] pci: Remove unneeded null pointer check
2011-01-15 18:01 [Qemu-devel] [PATCH] pci: Remove unneeded null pointer check Stefan Weil
@ 2011-01-15 18:11 ` Michael S. Tsirkin
2011-01-17 9:43 ` [Qemu-devel] " Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2011-01-15 18:11 UTC (permalink / raw)
To: Stefan Weil, kwolf; +Cc: QEMU Developers
On Sat, Jan 15, 2011 at 07:01:03PM +0100, Stefan Weil wrote:
> 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>
Looks sane. Kevin?
> ---
> hw/ide/pci.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ide/pci.c b/hw/ide/pci.c
> index 510b2de..f0db4f2 100644
> --- a/hw/ide/pci.c
> +++ b/hw/ide/pci.c
> @@ -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);
> --
> 1.7.2.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] pci: Remove unneeded null pointer check
2011-01-15 18:01 [Qemu-devel] [PATCH] pci: Remove unneeded null pointer check Stefan Weil
2011-01-15 18:11 ` [Qemu-devel] " Michael S. Tsirkin
@ 2011-01-17 9:43 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2011-01-17 9:43 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers, Michael S. Tsirkin
Am 15.01.2011 19:01, schrieb 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: bm
>
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-17 9:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-15 18:01 [Qemu-devel] [PATCH] pci: Remove unneeded null pointer check Stefan Weil
2011-01-15 18:11 ` [Qemu-devel] " Michael S. Tsirkin
2011-01-17 9:43 ` [Qemu-devel] " Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).