Переглянути джерело

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>
Peter Foley 3 роки тому
батько
коміт
41bcea7b2c
1 змінених файлів з 1 додано та 0 видалено
  1. 1 0
      net/tap.c

+ 1 - 0
net/tap.c

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