vhost: fix null pointer dereference
authorMarcin Kerlin <marcinx.kerlin@intel.com>
Wed, 15 Jun 2016 09:47:22 +0000 (11:47 +0200)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 22 Jun 2016 07:47:12 +0000 (09:47 +0200)
commitb4977246521c78de47d38b0c03fe78098f20945d
tree5799a3f001445e4b4893506abc92e76d2d6b770f
parent39449e7429024d0aaeba6ea63efc2c07b0d4c284
vhost: fix null pointer dereference

Return value of function get_device() is not checking before
dereference. Fix this problem by adding checking condition.

Coverity issue: 119262

Fixes: 77d20126b4c2 ("vhost-user: handle message to enable vring")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_user/virtio-net-user.c