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)
committerMark Brown <broonie@kernel.org>
Mon, 17 Apr 2023 19:16:26 +0000 (20:16 +0100)
commit1c34890273a020d61d6127ade3f68ed1cb21c16a
tree75d7c915a74a05bb4c00e274b55d77f031e70a83
parent97c236e2d4628bddbd1ac5877da030f9be291d30
ASoC: fsl_mqs: move of_node_put() to the correct location

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>
sound/soc/fsl/fsl_mqs.c