summaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-12-20 12:15:50 +0100
committerMark Brown <broonie@kernel.org>2015-12-23 00:01:53 +0000
commit10974ccf04b096fd79ad90fd50276b79c069f2cc (patch)
tree2dba369d476b6ef523bfb18a6fdcf4bdf5053006 /sound/soc/fsl
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
downloadlinux-10974ccf04b096fd79ad90fd50276b79c069f2cc.tar.bz2
ASoC: imx-pcm-dma: add NULL test
Add NULL test on call to devm_kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; @@ * x = devm_kzalloc(...); ... when != x == NULL *x // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/imx-pcm-dma.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c
index 1fc01ed3279d..f3d3d1ffa84e 100644
--- a/sound/soc/fsl/imx-pcm-dma.c
+++ b/sound/soc/fsl/imx-pcm-dma.c
@@ -62,6 +62,8 @@ int imx_pcm_dma_init(struct platform_device *pdev, size_t size)
config = devm_kzalloc(&pdev->dev,
sizeof(struct snd_dmaengine_pcm_config), GFP_KERNEL);
+ if (!config)
+ return -ENOMEM;
*config = imx_dmaengine_pcm_config;
if (size)
config->prealloc_buffer_size = size;