git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
vhost: fix crash by removing device when requested
[dpdk.git]
/
lib
/
librte_vhost
/
vhost_user
/
virtio-net-user.c
diff --git
a/lib/librte_vhost/vhost_user/virtio-net-user.c
b/lib/librte_vhost/vhost_user/virtio-net-user.c
index
97c5177
..
aa08706
100644
(file)
--- a/
lib/librte_vhost/vhost_user/virtio-net-user.c
+++ b/
lib/librte_vhost/vhost_user/virtio-net-user.c
@@
-109,6
+109,10
@@
user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)
if (dev == NULL)
return -1;
+ /* Remove from the data plane. */
+ if (dev->flags & VIRTIO_DEV_RUNNING)
+ notify_ops->destroy_device(dev);
+
if (dev->mem) {
free_mem_region(dev);
free(dev->mem);