Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1d70e5d authored by Emil Goode's avatar Emil Goode Committed by Olof Johansson
Browse files

ARM: imx: fix error handling in ipu device registration



If we fail to allocate struct platform_device pdev we
dereference it after the goto label err.

This bug was found using coccinelle.

Fixes: afa77ef3 (ARM: mx3: dynamically allocate "ipu-core" devices)
Signed-off-by: default avatarEmil Goode <emilgoode@gmail.com>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarShawn Guo <shawn.guo@freescale.com>
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parent 3bc4a87c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)