From c67daf4a24442d1bb404a11a6a54dc45ea10f234 Mon Sep 17 00:00:00 2001 From: linzhecheng Date: Tue, 12 Jun 2018 10:24:45 +0800 Subject: vhost-user: delete net client if necessary As qemu_new_net_client create new ncs but error happens later, ncs will be left in global net_clients list and we can't use them any more, so we need to cleanup them. Cc: qemu-stable@nongnu.org Signed-off-by: linzhecheng Signed-off-by: Jason Wang --- net/vhost-user.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'net') diff --git a/net/vhost-user.c b/net/vhost-user.c index 608b837175..a39f9c9974 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -345,6 +345,9 @@ err: s->vhost_user = NULL; } } + if (nc0) { + qemu_del_net_client(nc0); + } return -1; } -- cgit v1.2.3-55-g7522