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 E666B45C89; Tue, 5 Nov 2024 14:34:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D8F5402B3; Tue, 5 Nov 2024 14:34:40 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id D544540151 for ; Tue, 5 Nov 2024 14:34:38 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4A58o8Iq023146; Tue, 5 Nov 2024 05:34:30 -0800 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 42qg6urgds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Nov 2024 05:34:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aCkOAHJO/daCaGs1WfhAYNbT7uP7tBLUyX2m7ZTYxVs+abtdsTzmv7YxM6w2Vi7tUjRMPPG7LaT4yJipnYC7TBQAfJUrrcAS8twq/E3USPVN/2DILSpQ2UlPtqDJVm1aCQ6E+ZjaUEo+hE42W+SgliKmviiKRxE4BgfVBcAMKQ40FXczqRKEY5kle4BL6/FsbLf0mIBYDpVe9cboL6m2DB6Kv6Pp8gJg3Ycq/CaCtts1rS9i8xQBhJ3I1GqTuYCicAXWP7UE0X/UahmfH7+ewWzYHqvAPP+1awURox7GTB/bSVfMOSEIpEeNIOyMC5eSyivd3WE8CUCAETQgeivogA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HvNf7pw8mO5E4YZfe+IelE2kwtZZBhmVxHqWImzlbRA=; b=t27E5M7C19UOl9bb4+nEWrht+knvZokt32pdUoSouvqoXX6SCWKdNwo8AjqE4zjaQeLuIs6tyRT9Lt8/ujGmQBprCdT000NNCOfoG7Yj8Jbg0Y+XLwZ/j4jn7LUC3R5XXEboEuWyfjsPm67vSlajactSidHMeYVAVXhFL0h3QQF7rH8FZbj1eOJvDFS0ad5M3SBDyzx+/WaSE/k5tcGtRydjX7XNP+/O3gmp+XlJPHD3orl7jsrLybWLlVhtEOgjHKeZWpRnNL6kwW1car3Fq7r9SXI2MsLkOAquhUkZ3mvsENukHxMZPi8UiOthgWTvAqaICOPj5yw2XzR5JaOcLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HvNf7pw8mO5E4YZfe+IelE2kwtZZBhmVxHqWImzlbRA=; b=LwELQqkayc5wLsmTpJhmFTNMWdEs2YxHlmzfLZfsh2cc5DxrRZzJE6vT0S7NpxugtkQNl5Ri8yTRNhG7WfCengrlW6flGxqlldHxxlau6vEvtMy4DZ4bC/9k/NFfMpobgcI+421KXrtsRS512HQfMZDhGkk2SYVWLDh8WNlTPd0= Received: from PH0PR18MB5071.namprd18.prod.outlook.com (2603:10b6:510:16b::15) by SJ0PR18MB3803.namprd18.prod.outlook.com (2603:10b6:a03:2e9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.18; Tue, 5 Nov 2024 13:34:25 +0000 Received: from PH0PR18MB5071.namprd18.prod.outlook.com ([fe80::25e:7:91b:8f1c]) by PH0PR18MB5071.namprd18.prod.outlook.com ([fe80::25e:7:91b:8f1c%5]) with mapi id 15.20.8114.028; Tue, 5 Nov 2024 13:34:25 +0000 From: Kiran Kumar Kokkilagadda To: Pavan Nikhilesh Bhagavatula , Jerin Jacob , "chcchc88@163.com" , Nithin Kumar Dabilpuram , Zhirun Yan CC: "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula Subject: RE: [PATCH v2] graph: fix memory leak in node clone Thread-Topic: [PATCH v2] graph: fix memory leak in node clone Thread-Index: AQHbLDNOfrQbwe2jRkaWdV/VMx9Rx7KotkkA Date: Tue, 5 Nov 2024 13:34:25 +0000 Message-ID: References: <20241030121247.1400-1-pbhagavatula@marvell.com> <20241101073737.2003-1-pbhagavatula@marvell.com> In-Reply-To: <20241101073737.2003-1-pbhagavatula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB5071:EE_|SJ0PR18MB3803:EE_ x-ms-office365-filtering-correlation-id: ab00a5f2-52de-4f12-1db8-08dcfd9e908f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?y3pvKFF4Hi3oWmMs9yUFPp9ZJqvvAnUyboFtemqSf+RneptNKN4doqRYsRpw?= =?us-ascii?Q?ouLvetsMI/C13FMgvkWl59ar2sbkbYPCVLYBTLR8lq2u8UUuE+FoBIEMlhOU?= =?us-ascii?Q?BtlrI/rVIRTk7ZPObbD2fzt+lNTI0gZqEop6PkKKhlNUT5in4EkB9vZiDKmX?= =?us-ascii?Q?FGW+8rM4Q02Qq89Xi2C06FZlnn802dLbZXkldM6+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Q?Ioy3aIz7Mmc+fb/lKQTbUCeVnd2ue0zEDpYZSGDO6i3LIs5uAbPCxxBaakpm?= =?us-ascii?Q?o2sXRBtjhTQcZb+rr2Q6dUPhPQRL/RDC/eqxfEghrVyVs4wUXANZTUbdPdEQ?= =?us-ascii?Q?ytH1+CJDdEEM9uInozsQ52H6JprBxA+857Hcj6EJmDd/7VUUzL2g3JRRqmo7?= =?us-ascii?Q?+uGMgfU1hd//C4waXeiARH06WHpGZVW+KD0Aouxap6jaJwbqDUs2ZO41KAq5?= =?us-ascii?Q?84jVnW6fUkeOJqHhoAmSC+W/xTd2xSumtudz4uJcL6fr0ayCw0fZMdOADhy9?= =?us-ascii?Q?s4mAvWM=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB5071.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JL3UD/ZehCM7YtiECfU0i8q58JhMYu2UPCfWPxiBkKYkU4cJLWkB/lbu7qP4?= =?us-ascii?Q?CWQqrOXVY/87p/twyeiCMqu/Tq3MxsjtBoh8Wbhsyda/O6pGaxfZo5Z8IG6W?= =?us-ascii?Q?YUK4NMhGfx/xs7kfDseEfkIAXcQJDBUSKkkzdhkL4GqOBqegPHKDBrp4dqXP?= =?us-ascii?Q?/1VaJqobWay3btS651gYozVAvTxy0V24NBnvRvv78qWBMR6irD6mPGbBtBmc?= =?us-ascii?Q?p8EBLpeBW/QGDYzzEWpb/NuRsuDLnxcBYS5ocStUseWMRhA7sAULkkp8XuYt?= =?us-ascii?Q?3yUxqc3WUnp5ZWvrrULwM8l2V1lD/uoFF4TOq1WtsyC0l/miwZXFQ6TE+Zz1?= =?us-ascii?Q?WKNvoKbASYatRcxRPan131bIzOqcXAS8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q?yydrOBS0ZFL1HhgB4iHx+xb1C9W3uE2I2vV6T4OLNU/M1x8Gyw3mRIa1/mVs?= =?us-ascii?Q?kpBLepxaA70MU/P3Sr3lNGgXgxpFhMIcWzbpiNI120Y+ibaJYvHY8SH9uZIp?= =?us-ascii?Q?JWN9UBH1//xnFD7//EwUHsyoNrz1Mm5uCw6WSzM/SfFa6ak7tvd9Ei/67DsN?= =?us-ascii?Q?Vpboy5njwJNHNN6YXTCEwxp/SP3117vcz6MkVXMwRmTGDZUwUsS45P87QGVn?= =?us-ascii?Q?RBJzquQ3v75P1yhRMdMDH5bllN84v7XdnIZ528/EYmMRJoXvf2X3uHOwrRWY?= =?us-ascii?Q?j+2hQOd+RcapJVvyexexrzqlAMfjqE3nSeF4tJHf?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB5071.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab00a5f2-52de-4f12-1db8-08dcfd9e908f X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2024 13:34:25.1418 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HggbL2H45DInZdzIkREUocDZtiZyc+K3sJ4IOXbNDdyiNdw5wNZ6bcIC/b34fb4lmvf+vATDj5NVp1EOAFXVyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR18MB3803 X-Proofpoint-ORIG-GUID: h49R3uS0K0FL6Qo7Pah0wkwdJGT83X4H X-Proofpoint-GUID: h49R3uS0K0FL6Qo7Pah0wkwdJGT83X4H X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_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 > -----Original Message----- > From: pbhagavatula@marvell.com > Sent: Friday, November 1, 2024 1:08 PM > To: Jerin Jacob ; chcchc88@163.com; Kiran Kumar > Kokkilagadda ; Nithin Kumar Dabilpuram > ; Zhirun Yan > Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula > > Subject: [PATCH v2] graph: fix memory leak in node clone >=20 > From: Pavan Nikhilesh >=20 > Free memory allocated for the node when xstats memory allocation fails. >=20 > Coverity issue: 445529 > Fixes: 070db97e017b ("graph: support node xstats") >=20 > Signed-off-by: Pavan Nikhilesh > --- Acked-by: Kiran Kumar Kokkilagadda > v2 Changes: > - Fix one more leak. (Huichao cai) >=20 > lib/graph/node.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/graph/node.c b/lib/graph/node.c index > f15922892e..63db629da8 100644 > --- a/lib/graph/node.c > +++ b/lib/graph/node.c > @@ -156,7 +156,7 @@ node_clone(struct node *node, const char *name) > (node->xstats->nb_xstats * > RTE_NODE_XSTAT_DESC_SIZE)); > if (reg->xstats =3D=3D NULL) { > rte_errno =3D ENOMEM; > - goto fail; > + goto free; > } >=20 > for (i =3D 0; i < node->xstats->nb_xstats; i++) @@ -178,7 +178,7 > @@ node_clone(struct node *node, const char *name) >=20 > /* Naming ceremony of the new node. name is node->name + "-" + > name */ > if (clone_name(reg->name, node->name, name)) > - goto free; > + goto free_xstat; >=20 > rc =3D __rte_node_register(reg); > free_xstat: > -- > 2.25.1