From: Fabio Estevam Date: Fri, 28 Jun 2013 16:55:28 +0000 (-0300) Subject: imx-drm: ipu-dp: Check the return value of devm_kzalloc() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=55b31cf40654b32a75e7c010f9345f361ccae927;p=linux-beck.git 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 --- 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;