Commit 2b6b7903 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Zizhi Wo
Browse files

ASoC: mxs-saif: Fix refcount leak in mxs_saif_probe

stable inclusion
from stable-v4.19.247
commit 30d110ca703ce60162ec337aa564a3e4da30715f
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP75W
CVE: CVE-2022-49482

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



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

[ Upstream commit 2be84f73 ]

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.

Fixes: 08641c7c ("ASoC: mxs: add device tree support for mxs-saif")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220511133725.39039-1-linmq006@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
parent 3e8e3ea7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -777,6 +777,7 @@ static int mxs_saif_probe(struct platform_device *pdev)
		saif->master_id = saif->id;
	} else {
		ret = of_alias_get_id(master, "saif");
		of_node_put(master);
		if (ret < 0)
			return ret;
		else