patches for DPDK stable branches
 help / color / mirror / Atom feed
From: vanshika.shukla@nxp.com
To: dev@dpdk.org, Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Harman Kalra <hkalra@marvell.com>,
	David Marchand <david.marchand@redhat.com>,
	Hyong Youb Kim <hyonkim@cisco.com>
Cc: stable@dpdk.org, Apeksha Gupta <apeksha.gupta@nxp.com>,
	Vanshika Shukla <vanshika.shukla@nxp.com>
Subject: [v4 2/8] bus/dpaa: fix resource leak in variable dev
Date: Tue,  9 Jul 2024 15:34:59 +0530	[thread overview]
Message-ID: <20240709100505.2476972-3-vanshika.shukla@nxp.com> (raw)
In-Reply-To: <20240709100505.2476972-1-vanshika.shukla@nxp.com>

From: Apeksha Gupta <apeksha.gupta@nxp.com>

Resource leak:
variable dev is going out of scope leaks the storage.

Coverity issue: CID 373703
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Cc: hkalra@marvell.com
Cc: stable@dpdk.org

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 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 b8f41ec069..1f6997c77e 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


  parent reply	other threads:[~2024-07-09 10:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240703111644.1523242-1-vanshika.shukla@nxp.com>
2024-07-03 11:16 ` [PATCH 1/8] bus/dpaa: fix bus scan for DMA devices vanshika.shukla
2024-07-03 11:16 ` [PATCH 2/8] bus/dpaa: fix resource leak in variable dev vanshika.shukla
2024-07-03 11:16 ` [PATCH 3/8] common/dpaax: fix IOVA table cleanup vanshika.shukla
2024-07-03 11:16 ` [PATCH 4/8] common/dpaax: fix array overrun issue vanshika.shukla
2024-07-03 11:16 ` [PATCH 5/8] bus/dpaa: remove redundant file descriptor check vanshika.shukla
     [not found] ` <20240705074208.1902771-1-vanshika.shukla@nxp.com>
2024-07-05  7:42   ` [v2 1/7] bus/dpaa: fix bus scan for DMA devices vanshika.shukla
     [not found]     ` <20240708072945.2376209-1-vanshika.shukla@nxp.com>
2024-07-08  7:29       ` [PATCH v3 1/8] " vanshika.shukla
2024-07-08  7:29       ` [PATCH v3 2/8] bus/dpaa: fix resource leak in variable dev vanshika.shukla
2024-07-08 13:28         ` David Marchand
2024-07-08  7:29       ` [PATCH v3 3/8] common/dpaax: fix IOVA table cleanup vanshika.shukla
2024-07-08  7:29       ` [PATCH v3 4/8] common/dpaax: fix array overrun issue vanshika.shukla
2024-07-08  7:29       ` [PATCH v3 5/8] bus/dpaa: remove redundant file descriptor check vanshika.shukla
     [not found]       ` <20240709100505.2476972-1-vanshika.shukla@nxp.com>
2024-07-09 10:04         ` [v4 1/8] bus/dpaa: fix bus scan for DMA devices vanshika.shukla
2024-07-09 10:04         ` vanshika.shukla [this message]
2024-07-09 10:05         ` [v4 3/8] common/dpaax: fix IOVA table cleanup vanshika.shukla
2024-07-09 10:05         ` [v4 4/8] common/dpaax: fix array overrun issue vanshika.shukla
2024-07-09 10:05         ` [v4 5/8] bus/dpaa: remove redundant file descriptor check vanshika.shukla
2024-07-09 10:05         ` [v4 7/8] net/dpaa: restrict MTU config for shared intf vanshika.shukla
     [not found]         ` <20240710085534.2564668-1-vanshika.shukla@nxp.com>
2024-07-10  8:55           ` [v5 1/8] bus/dpaa: fix bus scan for DMA devices vanshika.shukla
2024-07-10  8:55           ` [v5 2/8] bus/dpaa: fix resource leak in variable dev vanshika.shukla
2024-07-10  8:55           ` [v5 3/8] common/dpaax: fix IOVA table cleanup vanshika.shukla
2024-07-10  8:55           ` [v5 4/8] common/dpaax: fix array overrun issue vanshika.shukla
2024-07-10  8:55           ` [v5 5/8] bus/dpaa: remove redundant file descriptor check vanshika.shukla
2024-07-10  8:55           ` [v5 7/8] net/dpaa: restrict MTU config for shared intf vanshika.shukla
2024-07-05  7:42   ` [v2 2/7] bus/dpaa: fix resource leak in variable dev vanshika.shukla
2024-07-05  7:42   ` [v2 3/7] common/dpaax: fix IOVA table cleanup vanshika.shukla
2024-07-05  7:42   ` [v2 4/7] common/dpaax: fix array overrun issue vanshika.shukla
2024-07-05  7:42   ` [v2 5/7] bus/dpaa: remove redundant file descriptor check vanshika.shukla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240709100505.2476972-3-vanshika.shukla@nxp.com \
    --to=vanshika.shukla@nxp.com \
    --cc=apeksha.gupta@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=hkalra@marvell.com \
    --cc=hyonkim@cisco.com \
    --cc=sachin.saxena@nxp.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).