linux-i3c.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] i3c: master: svc: drop free_irq of devm_request_irq allocated irq
@ 2021-06-02  8:49 Yang Yingliang
  2021-06-07  6:22 ` Miquel Raynal
  2021-06-09  0:03 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-06-02  8:49 UTC (permalink / raw)
  To: linux-kernel, linux-i3c; +Cc: alexandre.belloni, miquel.raynal

irq allocated with devm_request_irq() will be freed in devm_irq_release(),
using free_irq() in ->remove() will causes a dangling pointer, and a
subsequent double free. So remove the free_irq() in svc_i3c_master_remove().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
v2:
  removing free_irq() instead of using devm_free_irq()
---
 drivers/i3c/master/svc-i3c-master.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c
index 1f6ba4221817..eeb49b5d90ef 100644
--- a/drivers/i3c/master/svc-i3c-master.c
+++ b/drivers/i3c/master/svc-i3c-master.c
@@ -1448,7 +1448,6 @@ static int svc_i3c_master_remove(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	free_irq(master->irq, master);
 	clk_disable_unprepare(master->pclk);
 	clk_disable_unprepare(master->fclk);
 	clk_disable_unprepare(master->sclk);
-- 
2.25.1


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] i3c: master: svc: drop free_irq of devm_request_irq allocated irq
  2021-06-02  8:49 [PATCH -next v2] i3c: master: svc: drop free_irq of devm_request_irq allocated irq Yang Yingliang
@ 2021-06-07  6:22 ` Miquel Raynal
  2021-06-09  0:03 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2021-06-07  6:22 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, linux-i3c, alexandre.belloni

Hello,

Yang Yingliang <yangyingliang@huawei.com> wrote on Wed, 2 Jun 2021
16:49:35 +0800:

> irq allocated with devm_request_irq() will be freed in devm_irq_release(),
> using free_irq() in ->remove() will causes a dangling pointer, and a
> subsequent double free. So remove the free_irq() in svc_i3c_master_remove().
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] i3c: master: svc: drop free_irq of devm_request_irq allocated irq
  2021-06-02  8:49 [PATCH -next v2] i3c: master: svc: drop free_irq of devm_request_irq allocated irq Yang Yingliang
  2021-06-07  6:22 ` Miquel Raynal
@ 2021-06-09  0:03 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2021-06-09  0:03 UTC (permalink / raw)
  To: Yang Yingliang, linux-kernel, linux-i3c; +Cc: Alexandre Belloni, miquel.raynal

On Wed, 2 Jun 2021 16:49:35 +0800, Yang Yingliang wrote:
> irq allocated with devm_request_irq() will be freed in devm_irq_release(),
> using free_irq() in ->remove() will causes a dangling pointer, and a
> subsequent double free. So remove the free_irq() in svc_i3c_master_remove().

Applied, thanks!

[1/1] i3c: master: svc: drop free_irq of devm_request_irq allocated irq
      commit: 59a61e69c4252b4e8ecd15e752b0d2337f0121b7

Best regards,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-09  0:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02  8:49 [PATCH -next v2] i3c: master: svc: drop free_irq of devm_request_irq allocated irq Yang Yingliang
2021-06-07  6:22 ` Miquel Raynal
2021-06-09  0:03 ` Alexandre Belloni

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).