diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-04-30 16:43:55 +0530 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-05-03 12:09:48 -0500 |
commit | a1c5975270f2335e1d7129c084a6e562d7b99bdd (patch) | |
tree | 75f63b60e1cbe9b75684445021b933f973270e22 /hw/virtio-serial-bus.c | |
parent | f8778a7785d530515b0db395606f327fd5f94a92 (diff) |
virtio-serial: Fix check for 'assert'; prevent NULL derefs
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>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-serial-bus.c')
-rw-r--r-- | 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 97694d5216..3ce95e8f1e 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); } |