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 1F80AA0C4D for ; Mon, 6 Sep 2021 09:12:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E49A240C35; Mon, 6 Sep 2021 09:12:46 +0200 (CEST) Received: from mail-m973.mail.163.com (mail-m973.mail.163.com [123.126.97.3]) by mails.dpdk.org (Postfix) with ESMTP id 50C7140C35 for ; Mon, 6 Sep 2021 09:12:44 +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=Aa4pa r6ETJvv8drhDm6AHe4RuHkorhA4onZ9DZYfWtw=; b=jwTZ8wHeRpteen3VexHJ9 hP3dESxUfqCeXwHOSAGFt88lnfFee5NAT/Yk1OAQyZJkErQVdOKsieWnOCFJubjs +eM4zPypR0Bx61Ro9M3sc3k/3Vn2zdvZHIdV9ms8DX/2ktCPDDmMXZUYEGn038nO 7288lVY2pJi7dcI62rFfYQ= Received: from localhost.localdomain (unknown [124.160.214.74]) by smtp3 (Coremail) with SMTP id G9xpCgA3PM1mvzVhQL3hFw--.2445S2; Mon, 06 Sep 2021 15:12:41 +0800 (CST) From: Qiming Chen To: stable@dpdk.org Cc: beilei.xing@intel.com, Qiming Chen Date: Mon, 6 Sep 2021 15:11:56 +0800 Message-Id: <20210906071156.9813-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: G9xpCgA3PM1mvzVhQL3hFw--.2445S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruF45WFyxKF17Kw48JFWrXwb_yoWDZrc_GF 4Uury3Ars0k3WYgrWIkFs3uryFgFWrWrn5uFy2q3s3Wrs3ZayUAF48Crn2vwn7Gw47Ca45 CwnrG3W29345AjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0BBT7UUUUU== X-Originating-IP: [124.160.214.74] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/xtbBZwkGoFet3z6YIwAAso Subject: [dpdk-stable] [PATCH 20.11] net/i40e: fix vf resource leakage problem X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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