aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/pcm.c
diff options
context:
space:
mode:
authorTakashi Iwai <[email protected]>2011-02-24 10:05:01 +0100
committerTakashi Iwai <[email protected]>2011-02-24 10:05:01 +0100
commit1aa924e21eec9dbb2c5fae90a71451a700db4414 (patch)
tree27cc77862c7f7078c7339e2f9b4e52da12ad04c8 /sound/usb/pcm.c
parent786c51f9168cfd2d49250c6e5e60035cbb2fd5a1 (diff)
parentebbd224c22a00dbbee95031a0d6d595460f6f2b3 (diff)
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/usb/pcm.c')
-rw-r--r--sound/usb/pcm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 4132522ac90f..e3f680526cb5 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -361,6 +361,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
}
if (changed) {
+ mutex_lock(&subs->stream->chip->shutdown_mutex);
/* format changed */
snd_usb_release_substream_urbs(subs, 0);
/* influenced: period_bytes, channels, rate, format, */
@@ -368,6 +369,7 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
params_rate(hw_params),
snd_pcm_format_physical_width(params_format(hw_params)) *
params_channels(hw_params));
+ mutex_unlock(&subs->stream->chip->shutdown_mutex);
}
return ret;
@@ -385,8 +387,9 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream)
subs->cur_audiofmt = NULL;
subs->cur_rate = 0;
subs->period_bytes = 0;
- if (!subs->stream->chip->shutdown)
- snd_usb_release_substream_urbs(subs, 0);
+ mutex_lock(&subs->stream->chip->shutdown_mutex);
+ snd_usb_release_substream_urbs(subs, 0);
+ mutex_unlock(&subs->stream->chip->shutdown_mutex);
return snd_pcm_lib_free_vmalloc_buffer(substream);
}