From patchwork Tue Oct 20 15:02:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunjian Wang X-Patchwork-Id: 81598 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2909EA04DC; Tue, 20 Oct 2020 17:02:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4AE51A95F; Tue, 20 Oct 2020 17:02:55 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id 7431AA952; Tue, 20 Oct 2020 17:02:52 +0200 (CEST) Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9F5AA3C6D5235475AC7F; Tue, 20 Oct 2020 23:02:50 +0800 (CST) Received: from localhost (10.174.187.156) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Tue, 20 Oct 2020 23:02:40 +0800 From: wangyunjian To: CC: , , , , Yunjian Wang , Date: Tue, 20 Oct 2020 23:02:37 +0800 Message-ID: <6d9af419c1c9eeac76f59b7484471e69c4fa43a6.1603172717.git.wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.174.187.156] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/thunderx: fix memory leak when allocate rbdr desc ring fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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: Yunjian Wang In nicvf_qset_rbdr_alloc(), we allocate memory for the 'rbdr' structure but not released when allocate 'rbdr desc ring' fails. Fixes: 7413feee662d ("net/thunderx: add device start/stop and close") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Acked-by: Jerin Jacob --- drivers/net/thunderx/nicvf_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index f0bd20a22b..b6bb05e500 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -638,6 +638,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic, NICVF_RBDR_BASE_ALIGN_BYTES, nic->node); if (rz == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate mem for rbdr desc ring"); + rte_free(rbdr); return -ENOMEM; }