Commit 73935e93 authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: soc-core: tidyup error handling for rtd" from Kuninori...

Merge series "ASoC: soc-core: tidyup error handling for rtd" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are small clanup patches for soc-core.
[1/2] patch adds missing explanation, and
[2/2] patch fixup error handling of rtd.

Kuninori Morimoto (2):
  ASoC: soc-core: add comment for rtd freeing
  ASoC: soc-core: use device_unregister() if rtd allocation failed

 sound/soc/soc-core.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--
2.25.1
parents 9c0da293 5fa7553d
...@@ -413,6 +413,14 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd) ...@@ -413,6 +413,14 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)
* it is alloced *before* rtd. * it is alloced *before* rtd.
* see * see
* soc_new_pcm_runtime() * soc_new_pcm_runtime()
*
* We don't need to mind freeing for rtd,
* because it was created from dev (= rtd->dev)
* see
* soc_new_pcm_runtime()
*
* rtd = devm_kzalloc(dev, ...);
* rtd->dev = dev
*/ */
device_unregister(rtd->dev); device_unregister(rtd->dev);
} }
...@@ -462,8 +470,10 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( ...@@ -462,8 +470,10 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
dai_link->num_codecs + dai_link->num_codecs +
dai_link->num_platforms), dai_link->num_platforms),
GFP_KERNEL); GFP_KERNEL);
if (!rtd) if (!rtd) {
goto free_rtd; device_unregister(dev);
return NULL;
}
rtd->dev = dev; rtd->dev = dev;
INIT_LIST_HEAD(&rtd->list); INIT_LIST_HEAD(&rtd->list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment