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 07963A034E; Tue, 22 Feb 2022 19:19:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C628841180; Tue, 22 Feb 2022 19:19:00 +0100 (CET) Received: from out203-205-221-210.mail.qq.com (out203-205-221-210.mail.qq.com [203.205.221.210]) by mails.dpdk.org (Postfix) with ESMTP id 5D82B40E64 for ; Tue, 22 Feb 2022 19:18:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1645553937; bh=VR85ho/KZ3DfL/y2x7cS8w9f7CWAU4w+XlzMAyCxcus=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZHchRjgMtogqVMggjz3TndgX+FCs6IVNNNGaqiGe2tfoEgHmwfKx1uMcY1msYGXG1 bCiBisr9QHaJ6bXqi6sn8AHc1gIOd+RHpHnmzSkYhUnbyL/yQceIcL3qayUhS72wpp ZnC76iW4aLVX5C+baaiKx2i7qErh55W0P04F7caY= Received: from localhost.localdomain ([111.193.130.237]) by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP id 49223207; Wed, 23 Feb 2022 02:18:18 +0800 X-QQ-mid: xmsmtpt1645553932t6cvrfv8i Message-ID: X-QQ-XMAILINFO: OBvbJS/7aDyUsFxSfDJH6vq1V+apSQ0/PFMUWYDUqOSegtWtSsVa+k6dD4/jKc 0hd3qdVmS4QFT2c6pIcmTNbFR4HddIoMMdip7d60+RCRrSc7NnRus+NiJhfCIOmqBDr+DqtHeL/C +7XD7P9+//PH4p8UnSLkUzndHaWDvHZHPqoaHX4cobuNNU/ad09erggwrpa126A5P0ZXKz3tEGya 01qKxhKSYvOfiA0B28QABrt5na6xhhUreBL4pGOM9Pt7ng5HamIrJxPQbCOVeMW6oXPh+B9AouFP weOx+tC0y/vvwhhg8x/N7yLLNP6YsCNLrOPkS3KnKP+KVKJA3WAhf3qOZ++dBsb4wKlQCg+eZmqf VdXs/hPdZFf0jrtbWwS0VQ9cP7YxRcQrPkeWX9CqakDin+PhMWLSZHY5YaWha83IfzfYgNVwcJRy l3gyqhlR3Dz7PlF8AIKmrdYRPM6Zri4ICnpcwZTPFagEETHClVGCIBnnM4WaFplKQYiqE5oklD7M aA7E9ptom1+O+I5STBO+5Nwl9zY2+9+6PaS539CL5pWn9OLMkKL/yoMUcvWyloSReBzMN3FRQyoX qVDEjxVuVmyXQPrXYBbT9RiIgn3qydpHy35AkMVF2jWcp4nbYkJtEqjMoo4JG8bafcw7EVTd4ljL s40qD2AxKFSk9ZcsRmJVtV4SuXDRuwZEdsMzr4OTQGd9McBJ59yZZQ2W6qsTXg461YgUhBZwUL37 mUCF42CKZAUxPJq6uq6vOAzZ9AScg5lOCbVceHSIxGzJWQMCGeSSP78J/6/ztLDEcUhs5VpD/VYp lJQYYo5wfNjCbJM0oFxhpHwcNeoj9aatig6QDEZW7ecnbBNvef7YK9eE1t86ipPtF2bm3qZy4axA == From: Weiguo Li To: dev@dpdk.org Cc: adypodoman@gmail.com, xiaoyun.li@intel.com, tianfei.zhang@intel.com, bruce.richardson@intel.com, ivan.malov@oktetlabs.ru, jgrajcia@cisco.com, hkalra@marvell.com, ying.a.wang@intel.com, ting.xu@intel.com, simei.su@intel.com, qiming.yang@intel.com, motih@mellanox.com, shreyansh.jain@nxp.com, skoteshwar@marvell.com, stephen@networkplumber.org, kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com, declan.doherty@intel.com, gakhil@marvell.com, nicolas.chautru@intel.com Subject: [PATCH 08/20] net/cnxk: free 'node' memory when node add fail Date: Wed, 23 Feb 2022 02:18:06 +0800 X-OQ-MSGID: <36cc3a0c99f123a574b60cc34ac3a634a233a600.1645551559.git.liwg06@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 When node_add failed and function return, then the memory of 'node' is leaked. Fixes: 4435371b8fb1c0 ("net/cnxk: add TM shaper and node operations") Signed-off-by: Weiguo Li --- drivers/net/cnxk/cnxk_tm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/cnxk/cnxk_tm.c b/drivers/net/cnxk/cnxk_tm.c index 9015a452f8..81afafd5b7 100644 --- a/drivers/net/cnxk/cnxk_tm.c +++ b/drivers/net/cnxk/cnxk_tm.c @@ -389,6 +389,7 @@ cnxk_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id, if (rc < 0) { error->type = roc_nix_tm_err_to_rte_err(rc); error->message = roc_error_msg_get(rc); + rte_free(node); return rc; } error->type = RTE_TM_ERROR_TYPE_NONE; -- 2.25.1