From: Matthias Kaehlcke Date: Wed, 11 Jul 2012 15:36:34 +0000 (+0200) Subject: ASoC: Free memory in the error paths of soc_of_parse_audio_routing() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b761c0ca2e964a240d74e50da9e27dc0b3be0649;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 64b464ca3bc5..f219b2f7ee68 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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; } }