From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 392A0A04BC for ; Wed, 7 Oct 2020 09:37:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E1361B3EF; Wed, 7 Oct 2020 09:37:01 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id 69E691E35; Wed, 7 Oct 2020 09:36:56 +0200 (CEST) Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 096713E72E76FE3DB840; Wed, 7 Oct 2020 15:36:53 +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; Wed, 7 Oct 2020 15:36:46 +0800 From: wangyunjian To: CC: , , , , Yunjian Wang , Date: Wed, 7 Oct 2020 15:36:46 +0800 Message-ID: X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.187.156] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [dpdk-dev] [PATCH] net/fm10k: fix memory leak when Tx thresh check fails X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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" From: Yunjian Wang In fm10k_tx_queue_setup(), we allocate memory for the queue structure but not released when Tx thresh check fails. Fixes: 98068e0e044e ("fm10k: add Tx queue setup/release") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- drivers/net/fm10k/fm10k_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 309637071..c4a6fdf7f 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -2024,8 +2024,10 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, q->ops = &def_txq_ops; q->tail_ptr = (volatile uint32_t *) &((uint32_t *)hw->hw_addr)[FM10K_TDT(queue_id)]; - if (handle_txconf(q, conf)) + if (handle_txconf(q, conf)) { + rte_free(q); return -EINVAL; + } /* allocate memory for the software ring */ q->sw_ring = rte_zmalloc_socket("fm10k sw ring", -- 2.23.0