All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sound: soc: fix invalid free of devm_ allocated data
@ 2013-03-16 11:45 Silviu-Mihai Popescu
  2013-03-20 10:05 ` Mark Brown
  2013-03-20 10:06 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Silviu-Mihai Popescu @ 2013-03-16 11:45 UTC (permalink / raw)
  To: alsa-devel
  Cc: lgirdwood, broonie, perex, tiwai, linux-kernel,
	Silviu-Mihai Popescu

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>
---
 sound/soc/soc-core.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index b7e84a7..407b0a3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4197,7 +4197,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,
@@ -4206,7 +4205,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;
 		}
 	}
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-20 10:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-16 11:45 [PATCH] sound: soc: fix invalid free of devm_ allocated data Silviu-Mihai Popescu
2013-03-20 10:05 ` Mark Brown
2013-03-20 10:06 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.