From b19a05684955401203cc7f8893eaffae18205ed6 Mon Sep 17 00:00:00 2001 From: Chen Qun Date: Thu, 10 Feb 2022 10:28:59 +0800 Subject: [PATCH] tap: return err when tap TUNGETIFF fail When hotplug ovs kernel netcard, even tap TUNGETIFF failed, the hotplug would go on and would lead to qemu assert. The failure should lead to the free_fail. Signed-off-by: miaoyubo Signed-off-by: Yan Wang Signed-off-by: imxcc (cherry picked from commit fcfc664bacbb7d51d667dd6d0c20ce088bc7effe) --- tap-return-err-when-tap-TUNGETIFF-fail.patch | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tap-return-err-when-tap-TUNGETIFF-fail.patch diff --git a/tap-return-err-when-tap-TUNGETIFF-fail.patch b/tap-return-err-when-tap-TUNGETIFF-fail.patch new file mode 100644 index 0000000..f74fa19 --- /dev/null +++ b/tap-return-err-when-tap-TUNGETIFF-fail.patch @@ -0,0 +1,30 @@ +From 48a38f409a25f26605d65346c8ed9403c4b36c80 Mon Sep 17 00:00:00 2001 +From: Yan Wang +Date: Thu, 10 Feb 2022 10:28:59 +0800 +Subject: [PATCH] tap: return err when tap TUNGETIFF fail + +When hotplug ovs kernel netcard, even tap TUNGETIFF failed, +the hotplug would go on and would lead to qemu assert. +The failure should lead to the free_fail. + +Signed-off-by: miaoyubo +Signed-off-by: Yan Wang +--- + 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.27.0 +