2
0
Эх сурвалжийг харах

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>
linzhecheng 7 жил өмнө
parent
commit
c67daf4a24
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      net/vhost-user.c

+ 3 - 0
net/vhost-user.c

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