imx-drm: ipu-dp: Check the return value of devm_kzalloc()
authorFabio Estevam <fabio.estevam@freescale.com>
Fri, 28 Jun 2013 16:55:28 +0000 (13:55 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 20:33:14 +0000 (13:33 -0700)
devm_kzalloc() may fail, so let's check its return value.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/ipu-v3/ipu-dp.c

index 113b046c02259d4ee828ecafbc6fb5b2e0347e1f..04495158398efd4e65bd0511d3e1d57d8c72d187 100644 (file)
@@ -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;