]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
vhost-user: delete net client if necessary
authorlinzhecheng <linzhecheng@huawei.com>
Tue, 12 Jun 2018 02:24:45 +0000 (10:24 +0800)
committerJason Wang <jasowang@redhat.com>
Fri, 15 Jun 2018 02:39:53 +0000 (10:39 +0800)
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>
net/vhost-user.c

index 608b837175adbac4699b057904ef6a88902bd942..a39f9c9974dba5905e989e5a309fb1772241cdef 100644 (file)
@@ -345,6 +345,9 @@ err:
             s->vhost_user = NULL;
         }
     }
+    if (nc0) {
+        qemu_del_net_client(nc0);
+    }
 
     return -1;
 }