From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Weil <weil@mail.berlios.de>, kwolf@redhat.com
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH] pci: Remove unneeded null pointer check
Date: Sat, 15 Jan 2011 20:11:26 +0200 [thread overview]
Message-ID: <20110115181126.GA27287@redhat.com> (raw)
In-Reply-To: <1295114463-13806-1-git-send-email-weil@mail.berlios.de>
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
next prev parent reply other threads:[~2011-01-15 18:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-15 18:01 [Qemu-devel] [PATCH] pci: Remove unneeded null pointer check Stefan Weil
2011-01-15 18:11 ` Michael S. Tsirkin [this message]
2011-01-17 9:43 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110115181126.GA27287@redhat.com \
--to=mst@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=weil@mail.berlios.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).