diff mbox series

[v2] net/tap: Set return code on failure

Message ID 20220105164500.3381822-1-venture@google.com (mailing list archive)
State New, archived
Headers show
Series [v2] net/tap: Set return code on failure | expand

Commit Message

Patrick Leis Jan. 5, 2022, 4:45 p.m. UTC
From: Peter Foley <pefoley@google.com>

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>
---
v2: Fixed commit titlewq and updated description.
---
 net/tap.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jason Wang Jan. 6, 2022, 4:01 a.m. UTC | #1
在 2022/1/6 上午12:45, Patrick Venture 写道:
> From: Peter Foley <pefoley@google.com>
>
> 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>
> ---
> v2: Fixed commit titlewq and updated description.
> ---


Applied.

Thanks


>   net/tap.c | 1 +
>   1 file changed, 1 insertion(+)
>
> 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)) {
diff mbox series

Patch

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)) {