From: Peter Foley Date: Fri, 14 Jan 2022 05:08:58 +0000 (+0800) Subject: net/tap: Set return code on failure X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=41bcea7b2c99b8aec613beb62a6cdeb371a09449;p=qemu.git net/tap: Set return code on failure Match the other error handling in this function. Fixes: e7b347d0bf6 ("net: detect errors from probing vnet hdr flag for TAP devices") Reviewed-by: Patrick Venture Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Foley Signed-off-by: Jason Wang --- diff --git a/net/tap.c b/net/tap.c index f716be3e3f..c5cbeaa7a2 100644 --- a/net/tap.c +++ b/net/tap.c @@ -900,6 +900,7 @@ int net_init_tap(const Netdev *netdev, const char *name, if (i == 0) { vnet_hdr = tap_probe_vnet_hdr(fd, errp); if (vnet_hdr < 0) { + ret = -1; goto free_fail; } } else if (vnet_hdr != tap_probe_vnet_hdr(fd, NULL)) {