From patchwork Fri Sep 10 03:12:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiming Chen X-Patchwork-Id: 98535 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 52685A0548; Fri, 10 Sep 2021 05:13:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA9B54003F; Fri, 10 Sep 2021 05:13:44 +0200 (CEST) Received: from mail-m974.mail.163.com (mail-m974.mail.163.com [123.126.97.4]) by mails.dpdk.org (Postfix) with ESMTP id F24124003E; Fri, 10 Sep 2021 05:13:42 +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=EMBML ZTiLWUFY8o0retWfcgOQf/16BfoEevHCNZw/Eg=; b=Y7Ra+AyYPtElSh6q3Lmcr MgSwT1Q0n/eWmDJgDcvQfU2yPlbJl470KS1FC6lhVqBDOI+eQjSd35AnqRrlJu7V bFn1dCaCk4QTFZr0zPjh8MayA93csbGHKU0OoSOMG88kPPu41t5iGGRRyNoRXwAn UqEIqd1N88lUJ+v3Cr34gE= Received: from localhost.localdomain (unknown [124.160.213.250]) by smtp4 (Coremail) with SMTP id HNxpCgD3JClizTphH57_Bw--.610S2; Fri, 10 Sep 2021 11:13:40 +0800 (CST) From: Qiming Chen To: dev@dpdk.org Cc: beilei.xing@intel.com, jingjing.wu@intel.com, Qiming Chen , stable@dpdk.org Date: Fri, 10 Sep 2021 11:12:49 +0800 Message-Id: <20210910031249.11534-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 MIME-Version: 1.0 X-CM-TRANSID: HNxpCgD3JClizTphH57_Bw--.610S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJry8uFW3Zr1UCF15Cr45ZFb_yoW8Jw13pa 12kw10kryUtFsxW3yDGa4rXFy3Wa95Ga4SkFWxGas5ZwsIyFs5AFy8KasrtF98Zrs5AF1S qrW0g348J3ZxAF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jrVyxUUUUU= X-Originating-IP: [124.160.213.250] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/1tbiDgUKoFXl1RQSgAAAsC Subject: [dpdk-dev] [PATCH] common/iavf: fix arq resource leak 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" In the iavf_init_arq function, if an exception occurs in the iavf_config_arq_regs function, and the previously applied arq bufs resource is released. This patch maintains the same modification as the iavf_init_asq function to roll back resources. Fixes: 87aca6d8d8a4 ("net/iavf/base: fix command buffer memory leak") Cc: stable@dpdk.org Signed-off-by: Qiming Chen Acked-by: Qi Zhang --- drivers/common/iavf/iavf_adminq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/common/iavf/iavf_adminq.c b/drivers/common/iavf/iavf_adminq.c index 0bf5af0cbe..9c36e8908e 100644 --- a/drivers/common/iavf/iavf_adminq.c +++ b/drivers/common/iavf/iavf_adminq.c @@ -417,7 +417,7 @@ enum iavf_status iavf_init_arq(struct iavf_hw *hw) /* initialize base registers */ ret_code = iavf_config_arq_regs(hw); if (ret_code != IAVF_SUCCESS) - goto init_adminq_free_rings; + goto init_config_regs; /* success! */ hw->aq.arq.count = hw->aq.num_arq_entries; @@ -425,6 +425,10 @@ enum iavf_status iavf_init_arq(struct iavf_hw *hw) init_adminq_free_rings: iavf_free_adminq_arq(hw); + return ret_code; + +init_config_regs: + iavf_free_arq_bufs(hw); init_adminq_exit: return ret_code;