ALSA: Fix yet another race in disconnection
commit03685934bacb656ac9a3512c75b3c2bc910bbedb
authorTakashi Iwai <tiwai@suse.de>
Thu, 24 Mar 2011 08:50:15 +0000 (24 09:50 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 14 Apr 2011 23:52:46 +0000 (14 16:52 -0700)
treefa21d6cb857efb31ec54fe457fb74a3079926fdc
parenta9cdbcc98da9e84acf13d77ce7105e6bf5c3f99d
ALSA: Fix yet another race in disconnection

commit a45e3d6b13e97506b616980c0f122c3389bcefa4 upstream.

This patch fixes a race between snd_card_file_remove() and
snd_card_disconnect().  When the card is added to shutdown_files list
in snd_card_disconnect(), but it's freed in snd_card_file_remove() at
the same time, the shutdown_files list gets corrupted.  The list member
must be freed in snd_card_file_remove() as well.

Reported-and-tested-by: Russ Dill <russ.dill@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/core/init.c