qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] pci: Remove unneeded null pointer check


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH] pci: Remove unneeded null pointer check
Date: Sat, 15 Jan 2011 20:11:26 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 <address@hidden>
> Signed-off-by: Stefan Weil <address@hidden>

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]