Skip to content

Commit

Permalink
dmaengine: imx-sdma: return proper error if kzalloc fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Vinod Koul committed Jul 25, 2011
1 parent 0b052f4 commit 1c1d954
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/dma/imx-sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1c1d954

Please sign in to comment.