]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: mediatek: mt8192-mt6359: Fix error handling in mt8192_mt6359_dev_probe
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 8 Mar 2022 01:52:22 +0000 (01:52 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 8 Mar 2022 12:27:59 +0000 (12:27 +0000)
commitc3eee37f7e52629a665fa64d2ec5120c01ac2ccb
treeea5dc9973fcfe00bcfb49f0ffa08c7aae34c6cbf
parent28b7d30a7b5f32d46cdc2bf4873098c77643da59
ASoC: mediatek: mt8192-mt6359: Fix error handling in mt8192_mt6359_dev_probe

The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
Fix this by calling of_node_put() in error handling too.

Fixes: f0c08dfb186d ("ASoC: mediatek: mt8192-mt6359: fix device_node leak")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220308015224.23585-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c