mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
ASoC: Free memory in the error paths of soc_of_parse_audio_routing()
Release the memory of the routing table before leaving the function upon errors in the device tree Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
5c6af635fd
commit
b761c0ca2e
@ -4136,6 +4136,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
|
||||
dev_err(card->dev,
|
||||
"Property '%s' index %d could not be read: %d\n",
|
||||
propname, 2 * i, ret);
|
||||
kfree(routes);
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = of_property_read_string_index(np, propname,
|
||||
@ -4144,6 +4145,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
|
||||
dev_err(card->dev,
|
||||
"Property '%s' index %d could not be read: %d\n",
|
||||
propname, (2 * i) + 1, ret);
|
||||
kfree(routes);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user