Skip to content

Commit

Permalink
net/tap: Set return code on failure
Browse files Browse the repository at this point in the history
Match the other error handling in this function.

Fixes: e7b347d ("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>
  • Loading branch information
pefoley2 authored and jasowang committed Feb 14, 2022
1 parent f3e5a17 commit 41bcea7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/tap.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit 41bcea7

Please sign in to comment.