All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] net/tap: Set return code on failure
@ 2022-01-05 16:45 Patrick Venture
  2022-01-06  4:01 ` Jason Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Venture @ 2022-01-05 16:45 UTC (permalink / raw)
  To: f4bug, jasowang, pefoley; +Cc: qemu-devel, 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.
---
 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)) {
-- 
2.34.1.448.ga2b2bfdf31-goog



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] net/tap: Set return code on failure
  2022-01-05 16:45 [PATCH v2] net/tap: Set return code on failure Patrick Venture
@ 2022-01-06  4:01 ` Jason Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2022-01-06  4:01 UTC (permalink / raw)
  To: Patrick Venture, f4bug, pefoley; +Cc: qemu-devel


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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] net/tap: Set return code on failure
  2022-01-05 16:42 Patrick Venture
@ 2022-01-10 16:33 ` Stefano Garzarella
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Garzarella @ 2022-01-10 16:33 UTC (permalink / raw)
  To: Patrick Venture; +Cc: jasowang, pefoley, f4bug, qemu-devel

On Wed, Jan 05, 2022 at 08:42:14AM -0800, Patrick Venture wrote:
>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(+)
>
>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;

In case of error, `vnet_hdr` should contain an error code (negative), so 
we could assign `ret = vnet_hdr`, but looking at the implementation of 
tap_probe_vnet_hdr(), in case of error it returns just -1, so it's ok 
too:

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] net/tap: Set return code on failure
@ 2022-01-05 16:42 Patrick Venture
  2022-01-10 16:33 ` Stefano Garzarella
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Venture @ 2022-01-05 16:42 UTC (permalink / raw)
  To: f4bug, jasowang, pefoley; +Cc: qemu-devel, 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.
---
 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)) {
-- 
2.34.1.448.ga2b2bfdf31-goog



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-10 16:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 16:45 [PATCH v2] net/tap: Set return code on failure Patrick Venture
2022-01-06  4:01 ` Jason Wang
  -- strict thread matches above, loose matches on Subject: below --
2022-01-05 16:42 Patrick Venture
2022-01-10 16:33 ` Stefano Garzarella

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.