summaryrefslogtreecommitdiffstats
path: root/sound/usb/card.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-03-11 14:48:09 +0100
committerTakashi Iwai <tiwai@suse.de>2011-03-11 14:48:09 +0100
commitcc99a0861fa1c72335dc91a2e06d0b431911d55e (patch)
treeb5bba9600470f8a5e417519b7c2d5fd13d079c3b /sound/usb/card.c
parentbc3a8a01def4fb0ec0ef8a20d097277b9c6b2a1f (diff)
parent382225e62bdb8059b7f915b133426425516dd300 (diff)
downloadlinux-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.c4
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(&register_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(&register_mutex);
snd_card_free_when_closed(card);
} else {
+ mutex_unlock(&chip->shutdown_mutex);
mutex_unlock(&register_mutex);
}
}