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>
This commit is contained in:
parent
f8778a7785
commit
a1c5975270
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user