8deafcffaae134992def903576e2dec7cb7d1ab0
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0146-fixes-a-bug-in-the-snd-bcm2835-driver.patch
1 From f7af161699cbbca544dd8feab4c05d9bc5ea8807 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/174] 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 --- a/sound/arm/bcm2835-pcm.c
15 +++ b/sound/arm/bcm2835-pcm.c
16 @@ -127,7 +127,6 @@ static int snd_bcm2835_playback_open(str
17 alsa_stream->chip = chip;
18 alsa_stream->substream = substream;
19 alsa_stream->idx = idx;
20 - chip->alsa_stream[idx] = alsa_stream;
21
22 sema_init(&alsa_stream->buffers_update_sem, 0);
23 sema_init(&alsa_stream->control_sem, 0);
24 @@ -149,6 +148,7 @@ static int snd_bcm2835_playback_open(str
25 kfree(alsa_stream);
26 return err;
27 }
28 + chip->alsa_stream[idx] = alsa_stream;
29
30 alsa_stream->open = 1;
31 alsa_stream->draining = 1;