From: Amit Shah <amit.shah@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Amit Shah <amit.shah@redhat.com>,
qemu list <qemu-devel@nongnu.org>,
Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] [PATCH] virtio-serial: Fix check for 'assert'; prevent NULL derefs
Date: Fri, 30 Apr 2010 16:43:55 +0530 [thread overview]
Message-ID: <1272626035-14416-1-git-send-email-amit.shah@redhat.com> (raw)
In the flush_queued_data() function, we expect port to be valid. Assert
only for port and not port || discard.
Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
hw/virtio-serial-bus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 97694d5..3ce95e8 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -137,7 +137,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
static void flush_queued_data(VirtIOSerialPort *port, bool discard)
{
- assert(port || discard);
+ assert(port);
do_flush_queued_data(port, port->ovq, &port->vser->vdev, discard);
}
--
1.6.2.5
next reply other threads:[~2010-04-30 11:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-30 11:13 Amit Shah [this message]
2010-04-30 13:50 ` [Qemu-devel] Re: [PATCH] virtio-serial: Fix check for 'assert'; prevent NULL derefs Juan Quintela
2010-05-03 17:14 ` [Qemu-devel] " Anthony Liguori
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=1272626035-14416-1-git-send-email-amit.shah@redhat.com \
--to=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/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).