brcm2708: update 3.10 patches with raspberrypi/rpi-3.10.y of 27 Apr. 2014
[openwrt/svn-archive/archive.git] / target / linux / brcm2708 / patches-3.10 / 0195-snd-bcm2835-Ensure-alsa_stream-is-null-on-failure-to.patch
1 From 08223128145b351a4d47b6d1780c13eac5d8df95 Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Sun, 27 Apr 2014 17:52:12 +0100
4 Subject: [PATCH 195/196] snd-bcm2835: Ensure alsa_stream is null on failure to
5 avoid kernel panic
6
7 ---
8 sound/arm/bcm2835-pcm.c | 10 +++++-----
9 1 file changed, 5 insertions(+), 5 deletions(-)
10
11 diff --git a/sound/arm/bcm2835-pcm.c b/sound/arm/bcm2835-pcm.c
12 index 499e225..54a8f87 100755
13 --- a/sound/arm/bcm2835-pcm.c
14 +++ b/sound/arm/bcm2835-pcm.c
15 @@ -136,6 +136,11 @@ static int snd_bcm2835_playback_open(struct snd_pcm_substream *substream)
16 alsa_stream->enable_fifo_irq = 0;
17 alsa_stream->fifo_irq_handler = bcm2835_playback_fifo_irq;
18
19 + err = bcm2835_audio_open(alsa_stream);
20 + if (err != 0) {
21 + kfree(alsa_stream);
22 + return err;
23 + }
24 runtime->private_data = alsa_stream;
25 runtime->private_free = snd_bcm2835_playback_free;
26 runtime->hw = snd_bcm2835_playback_hw;
27 @@ -143,11 +148,6 @@ static int snd_bcm2835_playback_open(struct snd_pcm_substream *substream)
28 snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
29 16);
30
31 - err = bcm2835_audio_open(alsa_stream);
32 - if (err != 0) {
33 - kfree(alsa_stream);
34 - return err;
35 - }
36 chip->alsa_stream[idx] = alsa_stream;
37
38 alsa_stream->open = 1;
39 --
40 1.9.1
41