aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/pcm.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-03-01 23:20:20 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-03-01 23:20:20 +0000
commit8d3c3ddfa85837e24fad6fa39318617cbb59e843 (patch)
treef699dcaac2a11f0c9506ad111ae39fd5e3617c2d /sound/usb/pcm.c
parente8b2c3c47a53348aebbbeb5322e32937df958793 (diff)
parent6927faf30920b8c03dfa007e732642a1f1f20089 (diff)
Merge branch 'drm-intel-fixes' into drm-intel-next
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 4132522ac90..e3f680526cb 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);
}