Przeglądaj źródła

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 lat temu
rodzic
commit
c67daf4a24
1 zmienionych plików z 3 dodań i 0 usunięć
  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;
 }