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 <miaoyubo@huawei.com> Signed-off-by: Yan Wang <wangyan122@huawei.com> Signed-off-by: imxcc <xingchaochao@huawei.com> (cherry picked from commit fcfc664bacbb7d51d667dd6d0c20ce088bc7effe)
31 lines
981 B
Diff
31 lines
981 B
Diff
From 48a38f409a25f26605d65346c8ed9403c4b36c80 Mon Sep 17 00:00:00 2001
|
|
From: Yan Wang <wangyan122@huawei.com>
|
|
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 <miaoyubo@huawei.com>
|
|
Signed-off-by: Yan Wang <wangyan122@huawei.com>
|
|
---
|
|
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
|
|
|