From: Qais Yousef Date: Wed, 14 Jan 2015 08:47:29 +0000 (+0000) Subject: ASoC: soc-compress.c: fix NULL dereference X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~214^2~1^2~1^3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3268a40d4b19ff7bee23f52eabbc4e96bb685e8;p=pandora-kernel.git ASoC: soc-compress.c: fix NULL dereference In soc_new_compress() when rtd->dai_link->dynamic is set, we create the pcm substreams with this call: ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num, 1, 0, &be_pcm); which passes 0 as capture_count leading to be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream being NULL, hence when trying to set rtd a few lines below we get an oops. Fix by using rtd->dai_link->dpcm_playback and rtd->dai_link->dpcm_capture as playback_count and capture_count to snd_pcm_new_internal(). Signed-off-by: Qais Yousef Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- Reading git-diff-tree failed