mfd: sm501: Fix leaks in probe()
Subsystems (2)
PATCH 1/1 mfd: sm501: Fix leaks in probe()
This code should clean up if sm501_init_dev() fails.
Fixes b6d6454fdb66 ("[PATCH] mfd: SM501 core driver")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/mfd/sm501.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/mfd/sm501.c +7 -1
@@ -1415,8 +1415,14 @@ static int sm501_plat_probe(struct platform_device *dev) goto err_claim; } -return sm501_init_dev (sm); + ret =sm501_init_dev (sm); +if (ret) + goto err_unmap; + +return 0 ; + err_unmap: +iounmap (sm->regs); err_claim:release_mem_region (sm->io_res->start,0x100 ); err_res:
Signature · 1 line
2.28.0
Lee Jones
AppliedQuoted 7 lines · Dan Carpenter
This code should clean up if
sm501_init_dev()fails.Fixes b6d6454fdb66 ("[PATCH] mfd: SM501 core driver")Signed-off-by Dan Carpenter <[email protected]>--- drivers/mfd/sm501.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Applied, thanks.
Signature · 4 lines
Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog