Commit e7636f9e authored by Peng Wu's avatar Peng Wu Committed by Peng Zhang
Browse files

ARM: versatile: Add missing of_node_put in dcscb_init

stable inclusion
from stable-v4.19.247
commit a0fc05cd17617e63fc13ad0c01f3f0afd890d8ec
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP128
CVE: CVE-2022-49457

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a0fc05cd17617e63fc13ad0c01f3f0afd890d8ec



-------------------------------------------

[ Upstream commit 23b44f9c ]

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: default avatarPeng Wu <wupeng58@huawei.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220428230356.69418-1-linus.walleij@linaro.org

'
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 69d39b68
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ static int __init dcscb_init(void)
	if (!node)
		return -ENODEV;
	dcscb_base = of_iomap(node, 0);
	of_node_put(node);
	if (!dcscb_base)
		return -EADDRNOTAVAIL;
	cfg = readl_relaxed(dcscb_base + DCS_CFG_R);