Commit 97688a9c authored by tangbin's avatar tangbin Committed by Mark Brown

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: d2402860 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: default avatartangbin <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240903090620.6276-1-tangbin@cmss.chinamobile.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 568dc2fa
...@@ -127,8 +127,8 @@ static int loongson_card_parse_of(struct loongson_card_data *data) ...@@ -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"); codec = of_get_child_by_name(dev->of_node, "codec");
if (!codec) { if (!codec) {
dev_err(dev, "audio-codec property missing or invalid\n"); dev_err(dev, "audio-codec property missing or invalid\n");
ret = -EINVAL; of_node_put(cpu);
goto err; return -EINVAL;
} }
for (i = 0; i < card->num_links; i++) { for (i = 0; i < card->num_links; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment