aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlinzhecheng <linzhecheng@huawei.com>2018-06-12 10:24:45 +0800
committerJason Wang <jasowang@redhat.com>2018-06-15 10:39:53 +0800
commitc67daf4a24442d1bb404a11a6a54dc45ea10f234 (patch)
tree076c5367d214228c7344bd08cf16e5aa3fb1ad4d
parent2285a00c113469bb3e750ca4921cdb7baaae9e25 (diff)
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 <linzhecheng@huawei.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
-rw-r--r--net/vhost-user.c3
1 files changed, 3 insertions, 0 deletions
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;
}