summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-09-01 17:45:56 +0200
committerMohsin Kazmi <sykazmi@cisco.com>2020-09-01 17:47:36 +0200
commitc79d7353626f530de8bae436883622255e4ef9b2 (patch)
tree3fbf861e31031e3486ecd2cebe9e65fd128a666e
parentc96e64b61764b911f665696a54bd0318a22e7a4c (diff)
virtio: fix the NULL deference
Type: fix Change-Id: I8d55c2bfdd3c4607044370ebabf40cbac78b4996 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
-rw-r--r--src/vnet/devices/virtio/pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/pci.c b/src/vnet/devices/virtio/pci.c
index 48771170531..307e73bea2e 100644
--- a/src/vnet/devices/virtio/pci.c
+++ b/src/vnet/devices/virtio/pci.c
@@ -1219,7 +1219,8 @@ virtio_pci_delete_if (vlib_main_t * vm, virtio_if_t * vif)
if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ))
vif->virtio_pci_func->del_queue (vm, vif, vif->max_queue_pairs * 2);
- vif->virtio_pci_func->device_reset (vm, vif);
+ if (vif->virtio_pci_func)
+ vif->virtio_pci_func->device_reset (vm, vif);
if (vif->hw_if_index)
{