diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-03-11 14:48:09 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-03-11 14:48:09 +0100 |
commit | cc99a0861fa1c72335dc91a2e06d0b431911d55e (patch) | |
tree | b5bba9600470f8a5e417519b7c2d5fd13d079c3b /sound/usb/card.c | |
parent | bc3a8a01def4fb0ec0ef8a20d097277b9c6b2a1f (diff) | |
parent | 382225e62bdb8059b7f915b133426425516dd300 (diff) | |
download | linux-stable-cc99a0861fa1c72335dc91a2e06d0b431911d55e.tar.gz linux-stable-cc99a0861fa1c72335dc91a2e06d0b431911d55e.tar.bz2 linux-stable-cc99a0861fa1c72335dc91a2e06d0b431911d55e.zip |
Merge branch 'fix/misc' into topic/misc
Diffstat (limited to 'sound/usb/card.c')
-rw-r--r-- | sound/usb/card.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index 800f7cb4f251..c0f8270bc199 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -323,6 +323,7 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, return -ENOMEM; } + mutex_init(&chip->shutdown_mutex); chip->index = idx; chip->dev = dev; chip->card = card; @@ -531,6 +532,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) chip = ptr; card = chip->card; mutex_lock(®ister_mutex); + mutex_lock(&chip->shutdown_mutex); chip->shutdown = 1; chip->num_interfaces--; if (chip->num_interfaces <= 0) { @@ -548,9 +550,11 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) snd_usb_mixer_disconnect(p); } usb_chip[chip->index] = NULL; + mutex_unlock(&chip->shutdown_mutex); mutex_unlock(®ister_mutex); snd_card_free_when_closed(card); } else { + mutex_unlock(&chip->shutdown_mutex); mutex_unlock(®ister_mutex); } } |