vhost-net: always call vhost_dev_cleanup() on failure
commitf1a0365b686c2abdfde6303947f8893873b6b00b
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 26 Jul 2016 21:15:03 +0000 (27 01:15 +0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 28 Jul 2016 21:33:47 +0000 (29 00:33 +0300)
treee90d14cbba3a66fbfd4aef0e4111f7bec919eada
parente0547b59dc0ead4c605d3f02d1c8829630a1311b
vhost-net: always call vhost_dev_cleanup() on failure

vhost_dev_init(), calling vhost backend initialization, should be
cleaned up after failure too. Call vhost_dev_cleanup() in all failure
cases. First, it needs to zero-alloc the struct to avoid the initial
garbage.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/vhost_net.c