diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 64b464ca3bc55ff6aaa89678b5ee6227e1a04ba5..f219b2f7ee682c795bcf12ec2bea9b9855506b6f 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; } }