vhost: fix missing device checks
authorJerome Jutteau <jerome.jutteau@outscale.com>
Mon, 19 Oct 2015 09:44:27 +0000 (11:44 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 21 Oct 2015 10:21:18 +0000 (12:21 +0200)
commit6c6373c763748ca28805f215c3f646e127a7cf8a
tree124a40d4e3d7027f90d061ec8bbaf9b660e3f81c
parent2c95f4de6a7ec59c5793c64588066b6b2b8e6142
vhost: fix missing device checks

virtio-net search for it's device in reset_owner.
The function don't check the return result of get_config_ll_entry.
Using get_config_ll_entry in reset_owner don't show any error when the
device is not found. This patch fix this by using get_device instead
instead of get_config_ll_entry.

In user_get_vring_base, get_device return is not checked and may cause
segfault when device is not found.

Signed-off-by: Jerome Jutteau <jerome.jutteau@outscale.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_user/virtio-net-user.c
lib/librte_vhost/virtio-net.c