From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8FDC6A0C4E; Sat, 21 Aug 2021 10:15:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58A2540686; Sat, 21 Aug 2021 10:15:40 +0200 (CEST) Received: from mail-m971.mail.163.com (mail-m971.mail.163.com [123.126.97.1]) by mails.dpdk.org (Postfix) with ESMTP id B8C334003E; Sat, 21 Aug 2021 10:15:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=DICBq 93kPFlpqMF8nJ+CDMLmgBWZbLbl01dKNqyym7Q=; b=CcQBI90BNUbTz0QFJFyRU oyDv0DwzPhuFdz10CGzSWx8ep/83I/ebZtRNAOhroVhnfKMwNh3bnnWv4n805oUD ioNGhS/mhKzGNPtA2XkEFZ1f0yEuo3SOkorTC/QTvfyK42gMvFS78fedBJL97Jx6 4PDhHbzrJFkVda/5V4v0+w= Received: from localhost.localdomain (unknown [124.160.213.137]) by smtp1 (Coremail) with SMTP id GdxpCgA3C60KtiBhK_QXOg--.8401S2; Sat, 21 Aug 2021 16:15:08 +0800 (CST) From: chenqiming_huawei@163.com To: dev@dpdk.org Cc: beilei.xing@intel.com, Qiming Chen , stable@dpdk.org Date: Sat, 21 Aug 2021 16:14:26 +0800 Message-Id: <20210821081426.5700-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GdxpCgA3C60KtiBhK_QXOg--.8401S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruF45WFyxKF17Kw48JFWrXwb_yoWkJrX_GF 4UZr17Ars0k3WYgw4IkFs3ur1FgrWrWrn5uFy2q3s3WrsxZayUAF48Crn2vwn7KwsrCa45 AwnrG3W2934UAjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0CeHDUUUUU== X-Originating-IP: [124.160.213.137] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/1tbiDg31oFXl1GPswQAAs8 Subject: [dpdk-dev] [PATCH] net/i40e: fix vf resource leakage problem X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Qiming Chen In the i40evf_dev_init function, when the MAC memory alloc fails, the previously initialized vf resource is not released, resulting in leakage. The patch calls the i40evf_uninit_vf function in the abnormal branch to release resources. Fixes: 5c9222058df7 ("i40e: move to drivers/net/") Cc: stable@dpdk.org Signed-off-by: Qiming Chen --- drivers/net/i40e/i40e_ethdev_vf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 003d41373b..f64db72e9a 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1622,6 +1622,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to" " store MAC addresses", RTE_ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX); + (void)i40evf_uninit_vf(eth_dev); return -ENOMEM; } rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, -- 2.30.1.windows.1