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 857C745593 for ; Fri, 5 Jul 2024 09:42:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D709342FEF; Fri, 5 Jul 2024 09:42:15 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id DCC0040EE2; Fri, 5 Jul 2024 09:42:12 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BA775200570; Fri, 5 Jul 2024 09:42:12 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 81C77200128; Fri, 5 Jul 2024 09:42:12 +0200 (CEST) Received: from lsv03379.swis.in-blr01.nxp.com (lsv03379.swis.in-blr01.nxp.com [92.120.147.188]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id BB2BE180226C; Fri, 5 Jul 2024 15:42:11 +0800 (+08) From: vanshika.shukla@nxp.com To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena , David Marchand , Harman Kalra , Hyong Youb Kim Cc: stable@dpdk.org, Apeksha Gupta , Vanshika Shukla Subject: [v2 2/7] bus/dpaa: fix resource leak in variable dev Date: Fri, 5 Jul 2024 13:12:03 +0530 Message-Id: <20240705074208.1902771-3-vanshika.shukla@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240705074208.1902771-1-vanshika.shukla@nxp.com> References: <20240703111644.1523242-1-vanshika.shukla@nxp.com> <20240705074208.1902771-1-vanshika.shukla@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Apeksha Gupta Resource leak: variable dev is going out of scope leaks the storage. Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") Cc: hkalra@marvell.com Cc: stable@dpdk.org Signed-off-by: Apeksha Gupta Signed-off-by: Vanshika Shukla --- drivers/bus/dpaa/dpaa_bus.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index de190eb569..6ea27d8fb6 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -188,6 +188,7 @@ dpaa_create_device_list(void) if (dev->intr_handle == NULL) { DPAA_BUS_LOG(ERR, "Failed to allocate intr handle"); ret = -ENOMEM; + free(dev); goto cleanup; } @@ -239,6 +240,7 @@ dpaa_create_device_list(void) if (dev->intr_handle == NULL) { DPAA_BUS_LOG(ERR, "Failed to allocate intr handle"); ret = -ENOMEM; + free(dev); goto cleanup; } -- 2.25.1