linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] i2c: mpc: drop release for resource allocated with devm_*
@ 2021-04-12 16:00 Wei Yongjun
  2021-04-12 21:09 ` Chris Packham
  2021-04-13 12:20 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-04-12 16:00 UTC (permalink / raw)
  To: weiyongjun1, Chris Packham, Wolfram Sang
  Cc: linux-i2c, kernel-janitors, Hulk Robot

It's not necessary to release resource which allocated with devm_*
and those release may leads to a double free. And also remove useless
irq_dispose_mapping() call since mapping not created.

Fixes: 09aab7add7bf ("i2c: mpc: use device managed APIs")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/i2c/busses/i2c-mpc.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 46cdb36e2f9b..6e5614acebac 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -759,12 +759,6 @@ static int fsl_i2c_remove(struct platform_device *op)
 	if (i2c->clk_per)
 		clk_disable_unprepare(i2c->clk_per);
 
-	if (i2c->irq)
-		free_irq(i2c->irq, i2c);
-
-	irq_dispose_mapping(i2c->irq);
-	iounmap(i2c->base);
-	kfree(i2c);
 	return 0;
 };
 


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

end of thread, other threads:[~2021-04-13 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 16:00 [PATCH -next] i2c: mpc: drop release for resource allocated with devm_* Wei Yongjun
2021-04-12 21:09 ` Chris Packham
2021-04-13 12:20 ` Wolfram Sang

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