From 10974ccf04b096fd79ad90fd50276b79c069f2cc Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sun, 20 Dec 2015 12:15:50 +0100 Subject: 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/) // @@ expression x; @@ * x = devm_kzalloc(...); ... when != x == NULL *x // Signed-off-by: Julia Lawall Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/imx-pcm-dma.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc/fsl/imx-pcm-dma.c') 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; -- cgit v1.2.3