diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index 90da9bafda..d870ad97ab 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -293,6 +293,9 @@ vhost_destroy_device(struct vhost_device_ctx ctx) { struct virtio_net *dev = get_device(ctx); + if (dev == NULL) + return; + if (dev->flags & VIRTIO_DEV_RUNNING) notify_ops->destroy_device(dev);