From 919fdd4b693350b912110b729179ff0d6a390826 Mon Sep 17 00:00:00 2001 From: Hoegeun Kwon Date: Wed, 20 May 2020 16:41:06 +0900 Subject: [PATCH] ASoC: dmaengine: Add check to dma_dev A segmentation fault occurs when dma_dev is null. Add error handling for dma_dev. Change-Id: Ie8fa0b355c92bf59b937e3a5a399f8b299f94c74 Signed-off-by: Hoegeun Kwon --- sound/soc/soc-generic-dmaengine-pcm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 9ef80a4..738098f 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -118,6 +118,9 @@ dmaengine_pcm_set_runtime_hwparams(struct snd_soc_component *component, return -EINVAL; } + if (!dma_dev) + return -ENODEV; + if (pcm->config && pcm->config->pcm_hardware) return snd_soc_set_runtime_hwparams(substream, pcm->config->pcm_hardware); -- 2.7.4