]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: fsl_mqs: move of_node_put() to the correct location
authorLiliang Ye <yll@hust.edu.cn>
Mon, 3 Apr 2023 15:26:47 +0000 (23:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:29 +0000 (23:03 +0900)
commit57c612bdc4645d9a681f36c88c23515bb8965200
tree54efece798ffb6943dd2a4dc6d72e0930d890720
parentaf6474928ab738a416f80437f77cc5bcab9ef388
ASoC: fsl_mqs: move of_node_put() to the correct location

[ Upstream commit 1c34890273a020d61d6127ade3f68ed1cb21c16a ]

of_node_put() should have been done directly after
mqs_priv->regmap = syscon_node_to_regmap(gpr_np);
otherwise it creates a reference leak on the success path.

To fix this, of_node_put() is moved to the correct location, and change
all the gotos to direct returns.

Fixes: cb342f0f2ce6 ("ASoC: fsl_mqs: Fix error handling in probe")
Signed-off-by: Liliang Ye <yll@hust.edu.cn>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/20230403152647.17638-1-yll@hust.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/fsl/fsl_mqs.c