We should "goto failed" here, to delete net client, same
as for previous failure path in the function.

Fixes: 69036a855492 "net/tap: move vhost initialization to tap_setup_vhost()"
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
 net/tap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tap.c b/net/tap.c
index 9f829f49c1e..acccabca562 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -996,7 +996,7 @@ static bool net_init_tap_one(const NetdevTapOptions *tap, 
NetClientState *peer,
     s->vhostfd = vhostfd;
     s->vhost_busyloop_timeout = tap->has_poll_us ? tap->poll_us : 0;
     if (!tap_setup_vhost(s, errp)) {
-        return false;
+        goto failed;
     }
 
     return true;
-- 
2.43.0


Reply via email to