Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <tangbin@cmss.chinamobile.com>
Link: https://patch.msgid.link/20240903090620.6276-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

tangbin and committed by
Mark Brown
97688a9c 568dc2fa

+2 -2
+2 -2
sound/soc/loongson/loongson_card.c
··· 127 127 codec = of_get_child_by_name(dev->of_node, "codec"); 128 128 if (!codec) { 129 129 dev_err(dev, "audio-codec property missing or invalid\n"); 130 - ret = -EINVAL; 131 - goto err; 130 + of_node_put(cpu); 131 + return -EINVAL; 132 132 } 133 133 134 134 for (i = 0; i < card->num_links; i++) {