Commit f052df96 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Sebastian Reichel

power: reset: zx-reboot: put device node in zx_reboot_probe()

zx_reboot_probe() increments refcnt of zx296702-pcu device node by
of_find_compatible_node() and leaves it undecremented on both
successful and error paths.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: default avatarNicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent 91937b14
...@@ -51,6 +51,7 @@ static int zx_reboot_probe(struct platform_device *pdev) ...@@ -51,6 +51,7 @@ static int zx_reboot_probe(struct platform_device *pdev)
np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu"); np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu");
pcu_base = of_iomap(np, 0); pcu_base = of_iomap(np, 0);
of_node_put(np);
if (!pcu_base) { if (!pcu_base) {
iounmap(base); iounmap(base);
WARN(1, "failed to map pcu_base address"); WARN(1, "failed to map pcu_base address");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment