]> git.proxmox.com Git - mirror_qemu.git/commitdiff
net/tap: Set return code on failure
authorPeter Foley <pefoley@google.com>
Fri, 14 Jan 2022 05:08:58 +0000 (13:08 +0800)
committerJason Wang <jasowang@redhat.com>
Mon, 14 Feb 2022 03:50:44 +0000 (11:50 +0800)
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 <venture@google.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Foley <pefoley@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/tap.c

index f716be3e3fba2383eddf8391c728ddc4938b6f17..c5cbeaa7a2bef4b98e386eca889249feb79f8f5d 100644 (file)
--- 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)) {