diff options
author | Matthias Kaehlcke <matthias@kaehlcke.net> | 2012-07-11 11:36:34 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-11 13:40:57 -0400 |
commit | b761c0ca2e964a240d74e50da9e27dc0b3be0649 (patch) | |
tree | 30fc823891c0cba7aff989d0d932eed04bddc1a3 /sound | |
parent | 5c6af635fd77251b753cb1c07a6a6f306ba4e287 (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-core.c | 2 |
1 files changed, 2 insertions, 0 deletions
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, | |||
4136 | dev_err(card->dev, | 4136 | dev_err(card->dev, |
4137 | "Property '%s' index %d could not be read: %d\n", | 4137 | "Property '%s' index %d could not be read: %d\n", |
4138 | propname, 2 * i, ret); | 4138 | propname, 2 * i, ret); |
4139 | kfree(routes); | ||
4139 | return -EINVAL; | 4140 | return -EINVAL; |
4140 | } | 4141 | } |
4141 | ret = of_property_read_string_index(np, propname, | 4142 | ret = of_property_read_string_index(np, propname, |
@@ -4144,6 +4145,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, | |||
4144 | dev_err(card->dev, | 4145 | dev_err(card->dev, |
4145 | "Property '%s' index %d could not be read: %d\n", | 4146 | "Property '%s' index %d could not be read: %d\n", |
4146 | propname, (2 * i) + 1, ret); | 4147 | propname, (2 * i) + 1, ret); |
4148 | kfree(routes); | ||
4147 | return -EINVAL; | 4149 | return -EINVAL; |
4148 | } | 4150 | } |
4149 | } | 4151 | } |