projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
959b981
)
soc: aspeed: Fix a reference leak in aspeed_socinfo_init()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Fri, 13 Nov 2020 10:08:50 +0000
(13:08 +0300)
committer
Joel Stanley
<joel@jms.id.au>
Thu, 19 Nov 2020 12:31:15 +0000
(23:01 +1030)
This needs to call of_node_put(np) before returning if of_iomap() fails.
Fixes:
e0218dca5787
("soc: aspeed: Add soc info driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Link:
https://lore.kernel.org/r/20201113100850.GA168908@mwanda
Signed-off-by: Joel Stanley <joel@jms.id.au>
drivers/soc/aspeed/aspeed-socinfo.c
patch
|
blob
|
history
diff --git
a/drivers/soc/aspeed/aspeed-socinfo.c
b/drivers/soc/aspeed/aspeed-socinfo.c
index
20a1d4a
..
773930e
100644
(file)
--- a/
drivers/soc/aspeed/aspeed-socinfo.c
+++ b/
drivers/soc/aspeed/aspeed-socinfo.c
@@
-74,8
+74,10
@@
static int __init aspeed_socinfo_init(void)
}
reg = of_iomap(np, 0);
- if (!reg)
+ if (!reg) {
+ of_node_put(np);
return -ENODEV;
+ }
siliconid = readl(reg);
iounmap(reg);