ASoC: samsung: Fix refcount leak in aries_audio_probe
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 12 May 2022 04:38:28 +0000 (08:38 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:21:07 +0000 (10:21 +0200)
commitcacea459f95be22b3750f3b25b7a1c5897a68206
tree98f8c63835a98b5d196b6b4428d6c9c9604aa8fe
parentc1b08aa568e829b743affe5d3231e6de28b7609e
ASoC: samsung: Fix refcount leak in aries_audio_probe

[ Upstream commit bf4a9b2467b775717d0e9034ad916888e19713a3 ]

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
If extcon_find_edev_by_node() fails, it doesn't call of_node_put()
Calling of_node_put() after extcon_find_edev_by_node() to fix this.

Fixes: 7a3a7671fa6c ("ASoC: samsung: Add driver for Aries boards")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220512043828.496-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/samsung/aries_wm8994.c