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>
stable-3.0
linzhecheng 2018-06-12 10:24:45 +08:00 committed by Jason Wang
parent 2285a00c11
commit c67daf4a24
1 changed files with 3 additions and 0 deletions

View File

@ -345,6 +345,9 @@ err:
s->vhost_user = NULL;
}
}
if (nc0) {
qemu_del_net_client(nc0);
}
return -1;
}