mirror of https://github.com/proxmox/mirror_qemu
net/tap: Set return code on failure
Match the other error handling in this function.
Fixes: e7b347d0bf
("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>
master
parent
f3e5a17593
commit
41bcea7b2c
|
@ -900,6 +900,7 @@ int net_init_tap(const Netdev *netdev, const char *name,
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
vnet_hdr = tap_probe_vnet_hdr(fd, errp);
|
vnet_hdr = tap_probe_vnet_hdr(fd, errp);
|
||||||
if (vnet_hdr < 0) {
|
if (vnet_hdr < 0) {
|
||||||
|
ret = -1;
|
||||||
goto free_fail;
|
goto free_fail;
|
||||||
}
|
}
|
||||||
} else if (vnet_hdr != tap_probe_vnet_hdr(fd, NULL)) {
|
} else if (vnet_hdr != tap_probe_vnet_hdr(fd, NULL)) {
|
||||||
|
|
Loading…
Reference in New Issue