i2c: mpc: drop release for resource allocated with devm_*
PATCH 1/1 i2c: mpc: drop release for resource allocated with devm_*
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 <[email protected]>
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/i2c/busses/i2c-mpc.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/i2c/busses/i2c-mpc.c +0 -6
@@ -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 ; };
Quoted 7 lines · Wei Yongjun
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 <[email protected]>Signed-off-by Wei Yongjun <[email protected]>
Thanks for the fix.
Reviewed-by Chris Packham <[email protected]>
Quoted 22 lines
--- drivers/i2c/busses/i2c-mpc.c | 6 ------ 1 file changed, 6 deletions(-)drivers/i2c/busses/i2c-mpc.c +0
-6@@ -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 ; };
Wolfram Sang
AppliedQuoted 7 lines · Wei Yongjun
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 <[email protected]>Signed-off-by Wei Yongjun <[email protected]>
Applied to for-next, thanks!