vhost: fix crash after mmap failure
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 27 Nov 2018 09:54:51 +0000 (10:54 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Dec 2018 17:56:21 +0000 (17:56 +0000)
commitcf14478d775cadbaed4f5aa96e3812b44a2383c1
treedd74262bbeaf6867bdeb732fb1e41113a16cb171
parentd6db681bf9b8095da2fed653ec5b89e5f165eaa8
vhost: fix crash after mmap failure

If mmap() call fails in vhost_user_set_mem_table, dev->mem
is set to NULL. If later, qva_to_vva() is called, a segfault
occurs.

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
lib/librte_vhost/vhost_user.c