mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
ASoC: topology: Prevent use-after-free in snd_soc_get_pcm_runtime()
remove_link() is currently calling snd_soc_remove_dai_link() after it has already freed the memory for the link name. But this is later read from snd_soc_get_pcm_runtime() causing a KASAN use-after-free warning. Reorder the cleanups to fix this issue. Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
This commit is contained in:
parent
68ccd90e60
commit
54c96eae3e
|
|
@ -548,12 +548,12 @@ static void remove_link(struct snd_soc_component *comp,
|
|||
if (dobj->ops && dobj->ops->link_unload)
|
||||
dobj->ops->link_unload(comp, dobj);
|
||||
|
||||
list_del(&dobj->list);
|
||||
snd_soc_remove_dai_link(comp->card, link);
|
||||
|
||||
kfree(link->name);
|
||||
kfree(link->stream_name);
|
||||
kfree(link->cpus->dai_name);
|
||||
|
||||
list_del(&dobj->list);
|
||||
snd_soc_remove_dai_link(comp->card, link);
|
||||
kfree(link);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user