projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
529a110
)
mfd: sm501: Fix leaks in probe()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Fri, 11 Sep 2020 11:33:26 +0000
(14:33 +0300)
committer
Lee Jones
<lee.jones@linaro.org>
Wed, 30 Sep 2020 15:25:19 +0000
(16:25 +0100)
This code should clean up if sm501_init_dev() fails.
Fixes:
b6d6454fdb66
("[PATCH] mfd: SM501 core driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/sm501.c
patch
|
blob
|
history
diff --git
a/drivers/mfd/sm501.c
b/drivers/mfd/sm501.c
index
ccd62b9
..
6d2f4a0
100644
(file)
--- a/
drivers/mfd/sm501.c
+++ b/
drivers/mfd/sm501.c
@@
-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: