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 2B33BA050B; Thu, 7 Apr 2022 11:02:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A8C54068B; Thu, 7 Apr 2022 11:02:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id BCE1C40689 for ; Thu, 7 Apr 2022 11:02:47 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 2373c53B031954; Thu, 7 Apr 2022 02:02:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pfpt0220; bh=qPYwo+qXKmWzyXdSUIfx3/4DaC2qBzaRm56O13S7nSw=; b=WnsqS1I6VZWQruFHRVxmDTSkxgGFpt2w3rN4tcrYtqF24oB08PApELsS4BPJCtWC35N/ rEkWJEVtEqhCpBbM+h/IotVGFbRSE86kaUuZsEPzwKD0EN1wRiUSLdZDdnAJhy/Fjyc9 eBLYi/X9/PZdeQNsJJMtIOM2OOYeZml+jwphvwd5gD2oPNhNwvlXhC0IzWrWMnqVHY+P ikvu0zVk571SaDRZXHpG/HZyfabcATVpKYL58wP+tC90Rp86UQ8Tdt9wnUIutpHS4M6V xMCqKwCbBpI+1SNPv8m78rZivKnjMYpzauKwktaHfITejndrSiElwvTwSTLsma+Y7PAg gw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3f9r7eh42j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Apr 2022 02:02:45 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 7 Apr 2022 02:02:43 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 7 Apr 2022 02:02:43 -0700 Received: from [10.28.175.194] (unknown [10.28.175.194]) by maili.marvell.com (Postfix) with ESMTP id F018A3F7048; Thu, 7 Apr 2022 02:02:36 -0700 (PDT) Message-ID: <22a33b44-2ac2-6ab4-7074-48e6380d8992@marvell.com> Date: Thu, 7 Apr 2022 14:32:35 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 08/20] net/cnxk: free 'node' memory when node add fail Content-Language: en-US To: Weiguo Li , CC: , , , , , , , , , , , , , , , , , , , References: From: Nithin Kumar Dabilpuram In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: pHLHqVVf9i16H-ZTxR-B3bLWuqNWmLO_ X-Proofpoint-ORIG-GUID: pHLHqVVf9i16H-ZTxR-B3bLWuqNWmLO_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-04-06_13,2022-04-06_01,2022-02-23_01 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 Acked-by: Nithin Dabilpuram On 2/22/22 11:48 PM, Weiguo Li wrote: > 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;