aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Foley <pefoley@google.com>2022-01-14 13:08:58 +0800
committerJason Wang <jasowang@redhat.com>2022-02-14 11:50:44 +0800
commit41bcea7b2c99b8aec613beb62a6cdeb371a09449 (patch)
treed4f87b1500ed18464409dfa6fef754b1577fbb8c
parentf3e5a17593b972a9a6079ccf7677b4389d74d5a1 (diff)
downloadqemu-41bcea7b2c99b8aec613beb62a6cdeb371a09449.zip
qemu-41bcea7b2c99b8aec613beb62a6cdeb371a09449.tar.gz
qemu-41bcea7b2c99b8aec613beb62a6cdeb371a09449.tar.bz2
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 <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>
-rw-r--r--net/tap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tap.c b/net/tap.c
index f716be3..c5cbeaa 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)) {