[dpdk-dev,v2,2/4] vhost: check that a device exists during reset_owner
Commit Message
virtio-net search for it's device in reset_owner.
The function don't check the return result of get_config_ll_entry
which can be NULL.
Signed-off-by: Jerome Jutteau <jerome.jutteau@outscale.com>
---
lib/librte_vhost/virtio-net.c | 2 ++
1 file changed, 2 insertions(+)
@@ -402,6 +402,8 @@ reset_owner(struct vhost_device_ctx ctx)
uint64_t device_fh;
ll_dev = get_config_ll_entry(ctx);
+ if (ll_dev == NULL)
+ return -1;
device_fh = ll_dev->dev.device_fh;
cleanup_device(&ll_dev->dev);