dmaengine: imx-sdma: return proper error if kzalloc fails
authorAxel Lin <axel.lin@gmail.com>
Tue, 12 Jul 2011 13:00:13 +0000 (21:00 +0800)
committerVinod Koul <vinod.koul@intel.com>
Mon, 25 Jul 2011 13:41:12 +0000 (19:11 +0530)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/imx-sdma.c

index b6d1455..ec53980 100644 (file)
@@ -1281,8 +1281,10 @@ static int __init sdma_probe(struct platform_device *pdev)
                goto err_request_irq;
 
        sdma->script_addrs = kzalloc(sizeof(*sdma->script_addrs), GFP_KERNEL);
-       if (!sdma->script_addrs)
+       if (!sdma->script_addrs) {
+               ret = -ENOMEM;
                goto err_alloc;
+       }
 
        sdma->version = pdata->sdma_version;