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 BD0A4438E9; Wed, 17 Jan 2024 11:31:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C149E40DF8; Wed, 17 Jan 2024 11:31:19 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id DC19140DF8 for ; Wed, 17 Jan 2024 11:31:17 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40H8iLo6012661 for ; Wed, 17 Jan 2024 02:31:17 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= pfpt0220; bh=rTDiIAj8REKV1Wc9IF8ejh75L/NXp+/kd0RwR0pH7ro=; b=Ybh gMN0ytXOu5axtVi+oeWzOuKjA6r0Fxc6Klt70UDHZdyZWu+N/v7PdyTkZzC2/rRX 3TnumEqItOfg2G799gJNPKGibJ2pBuIXPqskMRZfuMk5vFBeNV1vKxU4vtPKoyFg 6zAPu2sFGtRdfNyG0bLhKTAFjpw1kLvFeiROnU5+bhqf73UerwphOJ97VgeIy0XE UciQ9ZnZ1ICaIEcdNo9lb8/Msbh/1ZoBeyZEMl2DcvfE9e8mJ0LSG1FI+masD8Kp g8X8c36wyCF9g5PXZCCYwWmqKVttBjIVNcgEoi2aqK/W5f8wE9O640OQGmzeLpk0 rOMrCKmQVbE7XlrqPVQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3vp0ge2jsf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 17 Jan 2024 02:31:17 -0800 (PST) Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 17 Jan 2024 02:31:14 -0800 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.48 via Frontend Transport; Wed, 17 Jan 2024 02:31:14 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.28.22.179]) by maili.marvell.com (Postfix) with ESMTP id 1A9865B6941; Wed, 17 Jan 2024 02:31:12 -0800 (PST) From: Anoob Joseph To: Akhil Goyal CC: Jerin Jacob , Vidya Sagar Velumuri , Tejasree Kondoj , Subject: [PATCH v3 01/24] common/cnxk: fix memory leak Date: Wed, 17 Jan 2024 16:00:46 +0530 Message-ID: <20240117103109.922-2-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240117103109.922-1-anoobj@marvell.com> References: <20240102045417.115-1-anoobj@marvell.com> <20240117103109.922-1-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: Tw-bNlutrRj9aRtCf2BWLU9ZaoRjPpmi X-Proofpoint-ORIG-GUID: Tw-bNlutrRj9aRtCf2BWLU9ZaoRjPpmi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_05,2024-01-17_01,2023-05-22_02 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 From: Akhil Goyal dev_init() acquires some resources which need to be cleaned in case a failure is observed afterwards. Fixes: c045d2e5cbbc ("common/cnxk: add CPT configuration") Signed-off-by: Akhil Goyal --- drivers/common/cnxk/roc_cpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c index 981e85a204..4e23d8c135 100644 --- a/drivers/common/cnxk/roc_cpt.c +++ b/drivers/common/cnxk/roc_cpt.c @@ -756,7 +756,7 @@ roc_cpt_dev_init(struct roc_cpt *roc_cpt) rc = dev_init(dev, pci_dev); if (rc) { plt_err("Failed to init roc device"); - goto fail; + return rc; } cpt->pci_dev = pci_dev; @@ -788,6 +788,7 @@ roc_cpt_dev_init(struct roc_cpt *roc_cpt) return 0; fail: + dev_fini(dev, pci_dev); return rc; } -- 2.25.1