]> Git Repo - linux.git/commitdiff
ARM: imx: fix error handling in ipu device registration
authorEmil Goode <[email protected]>
Mon, 19 May 2014 07:07:54 +0000 (15:07 +0800)
committerOlof Johansson <[email protected]>
Thu, 22 May 2014 05:16:56 +0000 (22:16 -0700)
If we fail to allocate struct platform_device pdev we
dereference it after the goto label err.

This bug was found using coccinelle.

Fixes: afa77ef (ARM: mx3: dynamically allocate "ipu-core" devices)
Signed-off-by: Emil Goode <[email protected]>
Acked-by: Uwe Kleine-König <[email protected]>
Cc: <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
arch/arm/mach-imx/devices/platform-ipu-core.c

index fc4dd7cedc1189019dea590e8a4caa6b0ebf6884..6bd7c3f37ac08e139118e48f200a075cb9fbac8b 100644 (file)
@@ -77,7 +77,7 @@ struct platform_device *__init imx_alloc_mx3_camera(
 
        pdev = platform_device_alloc("mx3-camera", 0);
        if (!pdev)
-               goto err;
+               return ERR_PTR(-ENOMEM);
 
        pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
        if (!pdev->dev.dma_mask)
This page took 0.059136 seconds and 4 git commands to generate.