From: Alexey Khoroshilov Date: Sat, 2 Jun 2018 22:22:05 +0000 (+0300) Subject: power: reset: zx-reboot: put device node in zx_reboot_probe() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f052df96c46dbe52fbacd02189e7906f41686f27;p=linux.git 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: Alexey Khoroshilov Reviewed-by: Nicholas Mc Guire Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/reset/zx-reboot.c b/drivers/power/reset/zx-reboot.c index c03e96e6a041f..186901c96c017 100644 --- a/drivers/power/reset/zx-reboot.c +++ b/drivers/power/reset/zx-reboot.c @@ -51,6 +51,7 @@ static int zx_reboot_probe(struct platform_device *pdev) np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu"); pcu_base = of_iomap(np, 0); + of_node_put(np); if (!pcu_base) { iounmap(base); WARN(1, "failed to map pcu_base address");