vhost: fix device leak on connection add failure
authorIlya Maximets <i.maximets@samsung.com>
Thu, 11 Apr 2019 10:23:06 +0000 (13:23 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 19 Apr 2019 12:51:54 +0000 (14:51 +0200)
commita21510e750430914a5638a8925e87609a32cbbff
treeb1d85f78339a129ef646d482eed22457b2b84a71
parent1e9868885f2ed388e827e8ce27d4b690c9b2fb90
vhost: fix device leak on connection add failure

Need to destroy allocated device if application fails to
add new connection or we have fdset failure.

Fixes: acbff5c67ea7 ("vhost: fix crash when exceeding file descriptors")
Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
lib/librte_vhost/socket.c