aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/usbaudio.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-04-17 12:53:26 +0200
committerTakashi Iwai <tiwai@suse.de>2008-04-24 12:00:39 +0200
commit9eb70e68f38bbc5996a2193e7b7dc0b5487a08cb (patch)
treef4079da04cd967a58e95b77b44a00e914d129f5f /sound/usb/usbaudio.c
parentf18638dcf0c481eca2430206ebcdc7295aec8623 (diff)
[ALSA] usb-audio - Fix race in reconnection
Fix the race at reconnection of the device. The disconnected usb_chip[] must be cleared before the next probe call properly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usbaudio.c')
-rw-r--r--sound/usb/usbaudio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 7b3bcf1916d..410be4aff1b 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -3424,7 +3424,6 @@ static void snd_usb_audio_create_proc(struct snd_usb_audio *chip)
static int snd_usb_audio_free(struct snd_usb_audio *chip)
{
- usb_chip[chip->index] = NULL;
kfree(chip);
return 0;
}
@@ -3689,6 +3688,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
list_for_each(p, &chip->mixer_list) {
snd_usb_mixer_disconnect(p);
}
+ usb_chip[chip->index] = NULL;
mutex_unlock(&register_mutex);
snd_card_free_when_closed(card);
} else {