mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 17:44:14 +08:00
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
This commit is contained in:
commit
73935e931c
@ -413,6 +413,14 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)
|
||||
* it is alloced *before* rtd.
|
||||
* see
|
||||
* 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);
|
||||
}
|
||||
@ -462,8 +470,10 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
|
||||
dai_link->num_codecs +
|
||||
dai_link->num_platforms),
|
||||
GFP_KERNEL);
|
||||
if (!rtd)
|
||||
goto free_rtd;
|
||||
if (!rtd) {
|
||||
device_unregister(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rtd->dev = dev;
|
||||
INIT_LIST_HEAD(&rtd->list);
|
||||
|
Loading…
Reference in New Issue
Block a user