aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortangbin <[email protected]>2024-09-03 17:06:20 +0800
committerMark Brown <[email protected]>2024-09-03 21:23:59 +0100
commit97688a9c5b1fd2b826c682cdfa36d411a5c99828 (patch)
tree682f657da8cc4fb14aca0756c8203140273fd517
parent568dc2fae5d3697033f5e28cf4d6225b3db00461 (diff)
ASoC: loongson: fix error release
In function loongson_card_parse_of(), when get device_node 'codec' failed, the function of_node_put(codec) should not be invoked, thus fix error release. Fixes: d24028606e76 ("ASoC: loongson: Add Loongson ASoC Sound Card Support") Signed-off-by: tangbin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/loongson/loongson_card.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/loongson/loongson_card.c b/sound/soc/loongson/loongson_card.c
index fae5e9312bf0..2c8dbdba27c5 100644
--- a/sound/soc/loongson/loongson_card.c
+++ b/sound/soc/loongson/loongson_card.c
@@ -127,8 +127,8 @@ static int loongson_card_parse_of(struct loongson_card_data *data)
codec = of_get_child_by_name(dev->of_node, "codec");
if (!codec) {
dev_err(dev, "audio-codec property missing or invalid\n");
- ret = -EINVAL;
- goto err;
+ of_node_put(cpu);
+ return -EINVAL;
}
for (i = 0; i < card->num_links; i++) {