From 55b31cf40654b32a75e7c010f9345f361ccae927 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 28 Jun 2013 13:55:28 -0300 Subject: [PATCH] imx-drm: ipu-dp: Check the return value of devm_kzalloc() devm_kzalloc() may fail, so let's check its return value. Signed-off-by: Fabio Estevam Acked-by: Sascha Hauer Acked-by: Philipp Zabel Signed-off-by: Greg Kroah-Hartman --- drivers/staging/imx-drm/ipu-v3/ipu-dp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dp.c b/drivers/staging/imx-drm/ipu-v3/ipu-dp.c index 113b046c0225..04495158398e 100644 --- a/drivers/staging/imx-drm/ipu-v3/ipu-dp.c +++ b/drivers/staging/imx-drm/ipu-v3/ipu-dp.c @@ -309,6 +309,8 @@ int ipu_dp_init(struct ipu_soc *ipu, struct device *dev, unsigned long base) int i; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; priv->dev = dev; priv->ipu = ipu; -- 2.20.1