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:
Amit Shah 2010-04-30 16:43:55 +05:30 committed by Anthony Liguori
parent f8778a7785
commit a1c5975270

View 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);
}