Skip to content

Commit bda7e9a

Browse files
committed
ASoC: core: Check for rtd == NULL in snd_soc_remove_pcm_runtime()
snd_soc_remove_pcm_runtime() might be called with rtd == NULL which will leads to null pointer dereference. This was reproduced with topology loading and marking a link as ignore due to missing hardware component on the system. On module removal the soc_tplg_remove_link() would call snd_soc_remove_pcm_runtime() with rtd == NULL since the link was ignored, no runtime was created. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent a8bfc8f commit bda7e9a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sound/soc/soc-core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,9 @@ static int snd_soc_compensate_channel_connection_map(struct snd_soc_card *card,
11391139
void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
11401140
struct snd_soc_pcm_runtime *rtd)
11411141
{
1142+
if (!rtd)
1143+
return;
1144+
11421145
lockdep_assert_held(&client_mutex);
11431146

11441147
/*

0 commit comments

Comments
 (0)