ARM: versatile: Add missing of_node_put in dcscb_init

The device_node pointer is returned by of_find_compatible_node
with refcount incremented. We should use of_node_put() to avoid
the refcount leak.

Signed-off-by: Peng Wu <wupeng58@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220428230356.69418-1-linus.walleij@linaro.org'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Peng Wu 2022-04-29 01:03:56 +02:00 committed by Arnd Bergmann
parent 0af2de76a2
commit 23b44f9c64
No known key found for this signature in database
GPG Key ID: 9A6C79EFE60018D9
1 changed files with 1 additions and 0 deletions

View File

@ -144,6 +144,7 @@ static int __init dcscb_init(void)
if (!node) if (!node)
return -ENODEV; return -ENODEV;
dcscb_base = of_iomap(node, 0); dcscb_base = of_iomap(node, 0);
of_node_put(node);
if (!dcscb_base) if (!dcscb_base)
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
cfg = readl_relaxed(dcscb_base + DCS_CFG_R); cfg = readl_relaxed(dcscb_base + DCS_CFG_R);