]> git.proxmox.com Git - qemu.git/commitdiff
virtio-serial: Fix check for 'assert'; prevent NULL derefs
authorAmit Shah <amit.shah@redhat.com>
Fri, 30 Apr 2010 11:13:55 +0000 (16:43 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 3 May 2010 17:09:48 +0000 (12:09 -0500)
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>
hw/virtio-serial-bus.c

index 97694d521635de498f97d658898e79a6cfe7bcb7..3ce95e8f1eaefedbecac938ce26dab9d65f06f3d 100644 (file)
@@ -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);
 }