diff options
| author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2018-06-02 18:22:05 -0400 |
|---|---|---|
| committer | Sebastian Reichel <sre@kernel.org> | 2018-06-28 08:20:38 -0400 |
| commit | f052df96c46dbe52fbacd02189e7906f41686f27 (patch) | |
| tree | ff9b56a3ecf489bd90ab9cb5db033b465a9ae3e1 | |
| parent | 91937b1478aa3e9eb93d6f68283786f3553213b3 (diff) | |
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 <khoroshilov@ispras.ru>
Reviewed-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
| -rw-r--r-- | drivers/power/reset/zx-reboot.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/power/reset/zx-reboot.c b/drivers/power/reset/zx-reboot.c index c03e96e6a041..186901c96c01 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) | |||
| 51 | 51 | ||
| 52 | np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu"); | 52 | np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu"); |
| 53 | pcu_base = of_iomap(np, 0); | 53 | pcu_base = of_iomap(np, 0); |
| 54 | of_node_put(np); | ||
| 54 | if (!pcu_base) { | 55 | if (!pcu_base) { |
| 55 | iounmap(base); | 56 | iounmap(base); |
| 56 | WARN(1, "failed to map pcu_base address"); | 57 | WARN(1, "failed to map pcu_base address"); |
