From patchwork Tue Sep 29 13:44:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunjian Wang X-Patchwork-Id: 79198 X-Patchwork-Delegate: ferruh.yigit@amd.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 D4F57A04B1; Tue, 29 Sep 2020 15:44:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F00B1D6A8; Tue, 29 Sep 2020 15:44:18 +0200 (CEST) Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by dpdk.org (Postfix) with ESMTP id 7A3361D523; Tue, 29 Sep 2020 15:44:15 +0200 (CEST) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8A315B53817AF5066926; Tue, 29 Sep 2020 21:44:12 +0800 (CST) Received: from localhost (10.174.185.168) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Tue, 29 Sep 2020 21:44:03 +0800 From: wangyunjian To: CC: , , , , , , Yunjian Wang , Date: Tue, 29 Sep 2020 21:44:00 +0800 Message-ID: X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.174.185.168] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/netvsc: fix txq leak in error path 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 hn_dev_tx_queue_setup() allocated memory for txq, we should free it when error happens, otherwise it will lead to memory leak. Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- drivers/net/netvsc/hn_rxtx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 65f1abae5..8c94e7ee3 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -273,6 +273,7 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev, " (tx_free_thresh=%u port=%u queue=%u)\n", nb_desc - 3, tx_free_thresh, dev->data->port_id, queue_idx); + rte_free(txq); return -EINVAL; }