ASoC: core: fix invalid free of devm_ allocated data
authorSilviu-Mihai Popescu <silviupopescu1990@gmail.com>
Sat, 16 Mar 2013 11:45:34 +0000 (13:45 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 20 Mar 2013 10:05:56 +0000 (11:05 +0100)
The objects allocated by devm_* APIs are managed by devres and are freed when
the device is detached. Hence there is no need to use kfree() explicitly.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-core.c

index 93341deaa4b9b565a8b2128cf0d7215b3c9eee30..507d251916af66ff81e0812714528ae02640d69e 100644 (file)
@@ -4199,7 +4199,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
                        dev_err(card->dev,
                                "ASoC: 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,
@@ -4208,7 +4207,6 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
                        dev_err(card->dev,
                                "ASoC: Property '%s' index %d could not be read: %d\n",
                                propname, (2 * i) + 1, ret);
-                       kfree(routes);
                        return -EINVAL;
                }
        }