ALSA: Fix yet another race in disconnection
authorTakashi Iwai <tiwai@suse.de>
Thu, 24 Mar 2011 08:50:15 +0000 (09:50 +0100)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:40:23 +0000 (11:40 -0700)
commite6a59718d076932bbe75b2f3c4cb1dc2a291a6bd
treebb5606b7e71a273281d3e18b80014873798ea592
parentd9aba67e6d82bc8490ecebc30ca608ae97c2c299
ALSA: Fix yet another race in disconnection

BugLink: http://bugs.launchpad.net/bugs/761134

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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
sound/core/init.c