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)
commit402299cca89273b62384b5f9645ea49cd5fc4a57
tree54efece798ffb6943dd2a4dc6d72e0930d890720
parent225e81c3af9e1b8d82647a15e60dd8c7a2607c33
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: a9d273671440 ("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