net/virtio: fix crash while freeing mbufs
authorDavid Harton <dharton@cisco.com>
Sat, 3 Feb 2018 14:55:23 +0000 (09:55 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 5 Feb 2018 18:56:04 +0000 (19:56 +0100)
commitb87c06483ae805846bfb3ec2594c62ac80f0a8e1
tree2149869b31e103ee7d7e022a7ad64099f25e3203
parent73b1c1ae4e04c78230b2e5d94dcf30ddb1ed3133
net/virtio: fix crash while freeing mbufs

virtio_dev_free_mbufs was recently modified to free the
virtqueues but failed to check whether the array was
allocated.  Added a check to ensure vqs was non-null.

Fixes: bdb32afbb610 ("net/virtio: rationalize queue flushing")

Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c