From: Mark Hills Date: Sat, 24 Oct 2009 11:59:36 +0000 (+0100) Subject: ALSA: snd-usb-caiaq: Lock on stream start/unpause X-Git-Tag: v3.0~7044^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac9dd9d384b018f1e1c5a9a2686ab5605ce55818;p=platform%2Fkernel%2Flinux-amlogic.git ALSA: snd-usb-caiaq: Lock on stream start/unpause Fix a bug which can result in white noise from the driver after stream start or unpause. Signed-off-by: Mark Hills Acked-by: Daniel Mack Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index e76017c..86b2c3b 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -62,10 +62,14 @@ static void activate_substream(struct snd_usb_caiaqdev *dev, struct snd_pcm_substream *sub) { + spin_lock(&dev->spinlock); + if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) dev->sub_playback[sub->number] = sub; else dev->sub_capture[sub->number] = sub; + + spin_unlock(&dev->spinlock); } static void