net/vhost: fix setup error path
net/vhost: fix setup error path

If for some reason vhost_driver_setup() fails, the list
element for the device may be freed without being removed
from the internal list of devices.

This patch fixes all the error paths, by unregistering the
device from Vhost library it has been registered, remove
the device from the list, reset device vring_state pointer
from the global table and only free vring state if it had
been allocated.

Fixes: 3d01b759d267 ("net/vhost: delay driver setup")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <9a2667dee3b90866bbc9c2696cff2b7d5616c95a@redhat.com>
Reviewed-by: David Marchand <f28529695cfa9e3e1eb84e7072aa626af4abb18e@redhat.com>
Reviewed-by: Tiwei Bie <f338cf29d7d69ff1bc99f755ebfb0eb0accd409e@intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk