brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0146-fixes-a-bug-in-the-snd-bcm2835-driver.patch
1 From bd15c8ebc85f89b3e3c464a628f70ea4b144377f Mon Sep 17 00:00:00 2001
2 From: Janis Danisevskis <werwurm@snafu.de>
3 Date: Wed, 1 Jan 2014 18:41:53 +0100
4 Subject: [PATCH 146/196] fixes a bug in the snd-bcm2835 driver
5
6 The "instance" field of bcm2835_alsa_stream_t may be accessed uninitialized
7 by bcm2835_audio_set_ctls_chan if called during stream creation. This fix
8 deferres the addition to of the stream to chip untill it has been fully
9 initialized.
10 ---
11  sound/arm/bcm2835-pcm.c | 2 +-
12  1 file changed, 1 insertion(+), 1 deletion(-)
13
14 diff --git a/sound/arm/bcm2835-pcm.c b/sound/arm/bcm2835-pcm.c
15 index 21e435b..499e225 100755
16 --- a/sound/arm/bcm2835-pcm.c
17 +++ b/sound/arm/bcm2835-pcm.c
18 @@ -127,7 +127,6 @@ static int snd_bcm2835_playback_open(struct snd_pcm_substream *substream)
19         alsa_stream->chip = chip;
20         alsa_stream->substream = substream;
21         alsa_stream->idx = idx;
22 -       chip->alsa_stream[idx] = alsa_stream;
23  
24         sema_init(&alsa_stream->buffers_update_sem, 0);
25         sema_init(&alsa_stream->control_sem, 0);
26 @@ -149,6 +148,7 @@ static int snd_bcm2835_playback_open(struct snd_pcm_substream *substream)
27                 kfree(alsa_stream);
28                 return err;
29         }
30 +       chip->alsa_stream[idx] = alsa_stream;
31  
32         alsa_stream->open = 1;
33         alsa_stream->draining = 1;
34 -- 
35 1.9.1
36