summaryrefslogtreecommitdiff
path: root/sound/soc/amd
diff options
context:
space:
mode:
authorAgrawal, Akshu <Akshu.Agrawal@amd.com>2018-06-07 14:48:43 +0800
committerMark Brown <broonie@kernel.org>2018-06-18 12:33:08 +0100
commit6e56e5d04191aa20e08430dcb203c081fa247e93 (patch)
tree5de4f56d4f8c1cdfdf865d50a2d97dd097172bf1 /sound/soc/amd
parent203cdf51f28820bee7893b4be392847418e6f4ec (diff)
ASoC: AMD: Add NULL pointer check
Fix crash in those platforms whose machine driver does not expose platform_info. For those platforms we rely on default value and select I2SSP channel. Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd')
-rw-r--r--sound/soc/amd/acp-pcm-dma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c
index 77203841c535..1458b5048498 100644
--- a/sound/soc/amd/acp-pcm-dma.c
+++ b/sound/soc/amd/acp-pcm-dma.c
@@ -773,7 +773,8 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream,
if (WARN_ON(!rtd))
return -EINVAL;
- rtd->i2s_instance = pinfo->i2s_instance;
+ if (pinfo)
+ rtd->i2s_instance = pinfo->i2s_instance;
if (adata->asic_type == CHIP_STONEY) {
val = acp_reg_read(adata->acp_mmio,
mmACP_I2S_16BIT_RESOLUTION_EN);