[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240623074019.2083481-1-make24@iscas.ac.cn>
Date: Sun, 23 Jun 2024 15:40:19 +0800
From: Ma Ke <make24@...as.ac.cn>
To: hao.wu@...el.com,
trix@...hat.com,
mdf@...nel.org,
yilun.xu@...el.com
Cc: linux-fpga@...r.kernel.org,
linux-kernel@...r.kernel.org,
Ma Ke <make24@...as.ac.cn>
Subject: [PATCH] fpga: dfl: fix potential memory leak in vfio_intx_enable()
We should free 'feature->irq_ctx[idx].name' to avoid 'name'
memory leak when request_irq() failed.
Signed-off-by: Ma Ke <make24@...as.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
Powered by blists - more mailing lists