Message ID | 20200107070956.15807-1-tiwai@suse.de |
---|---|
State | Accepted |
Commit | 8e3366cad2bfe4e669bfd3758110be90b1dc75aa |
Headers | show |
Series | ASoC: Fix NULL dereference at freeing | expand |
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 9054558ce386..b94680fb26fa 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -539,6 +539,9 @@ void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd) struct snd_soc_rtdcom_list *rtdcom; struct snd_soc_component *component; + if (!rtd->pcm) + return; + for_each_rtd_components(rtd, rtdcom, component) if (component->driver->pcm_destruct) component->driver->pcm_destruct(component, rtd->pcm);