2
0
Эх сурвалжийг харах

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>
Amit Shah 15 жил өмнө
parent
commit
a1c5975270

+ 1 - 1
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);
 }