aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mid-x86
diff options
context:
space:
mode:
authorJoachim Eastwood <joachim.eastwood@jotron.com>2011-12-31 19:58:44 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-07 14:18:05 -0500
commit25e9e7565f9aa9e4b976387a3fab60bfaa4efac8 (patch)
tree4a937cd72ecbd52980d09799aab0092a0f1bb4b8 /sound/soc/mid-x86
parent739be96ab83755e10fd0c2b6a34c8a73254527f7 (diff)
ASoC: check for substream not channels_min in pcm engines
This is a follow up on 53dea36c70c1857 which fixes the other affected pcm engines. Description from 53dea36c70c1857: Don't rely on the codec's channels_min information to decide wheter or not allocate a substream's DMA buffer. Rather check if the substream itself was allocated previously. Without this patch I was seeing null-pointer dereferenc in atmel-pcm. Signed-off-by: Joachim Eastwood <joachim.eastwood@jotron.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/mid-x86')
-rw-r--r--sound/soc/mid-x86/sst_platform.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c
index c2bf172a196e..d34563b12c3b 100644
--- a/sound/soc/mid-x86/sst_platform.c
+++ b/sound/soc/mid-x86/sst_platform.c
@@ -446,13 +446,12 @@ static void sst_pcm_free(struct snd_pcm *pcm)
446 446
447static int sst_pcm_new(struct snd_soc_pcm_runtime *rtd) 447static int sst_pcm_new(struct snd_soc_pcm_runtime *rtd)
448{ 448{
449 struct snd_soc_dai *dai = rtd->cpu_dai;
450 struct snd_pcm *pcm = rtd->pcm; 449 struct snd_pcm *pcm = rtd->pcm;
451 int retval = 0; 450 int retval = 0;
452 451
453 pr_debug("sst_pcm_new called\n"); 452 pr_debug("sst_pcm_new called\n");
454 if (dai->driver->playback.channels_min || 453 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream ||
455 dai->driver->capture.channels_min) { 454 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
456 retval = snd_pcm_lib_preallocate_pages_for_all(pcm, 455 retval = snd_pcm_lib_preallocate_pages_for_all(pcm,
457 SNDRV_DMA_TYPE_CONTINUOUS, 456 SNDRV_DMA_TYPE_CONTINUOUS,
458 snd_dma_continuous_data(GFP_KERNEL), 457 snd_dma_continuous_data(GFP_KERNEL),