mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
mfd: sm501: Fix leaks in probe()
This code should clean up if sm501_init_dev() fails.
Fixes: b6d6454fdb ("[PATCH] mfd: SM501 core driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
@@ -1415,8 +1415,14 @@ static int sm501_plat_probe(struct platform_device *dev)
|
|||||||
goto err_claim;
|
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:
|
err_claim:
|
||||||
release_mem_region(sm->io_res->start, 0x100);
|
release_mem_region(sm->io_res->start, 0x100);
|
||||||
err_res:
|
err_res:
|
||||||
|
|||||||
Reference in New Issue
Block a user