From: Ma Ke <make24@iscas.ac.cn>
To: hao.wu@intel.com, trix@redhat.com, mdf@kernel.org, yilun.xu@intel.com
Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org,
Ma Ke <make24@iscas.ac.cn>
Subject: [PATCH] fpga: dfl: fix potential memory leak in vfio_intx_enable()
Date: Sun, 23 Jun 2024 15:40:19 +0800 [thread overview]
Message-ID: <20240623074019.2083481-1-make24@iscas.ac.cn> (raw)
We should free 'feature->irq_ctx[idx].name' to avoid 'name'
memory leak when request_irq() failed.
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
drivers/fpga/dfl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c
index 094ee97ea26c..c52ebece5aef 100644
--- a/drivers/fpga/dfl.c
+++ b/drivers/fpga/dfl.c
@@ -1911,7 +1911,7 @@ static int do_set_irq_trigger(struct dfl_feature *feature, unsigned int idx,
feature->irq_ctx[idx].name, trigger);
if (!ret) {
feature->irq_ctx[idx].trigger = trigger;
- return ret;
+ goto free_name;
}
eventfd_ctx_put(trigger);
--
2.25.1
next reply other threads:[~2024-06-23 7:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-23 7:40 Ma Ke [this message]
2024-06-23 12:52 ` [PATCH] fpga: dfl: fix potential memory leak in vfio_intx_enable() Markus Elfring
2024-06-24 17:58 ` Russ Weight
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=20240623074019.2083481-1-make24@iscas.ac.cn \
--to=make24@iscas.ac.cn \
--cc=hao.wu@intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
/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).