summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorEmil Goode2014-05-19 09:07:54 +0200
committerOlof Johansson2014-05-22 07:16:56 +0200
commitd1d70e5dc2cfa9047bb935c41ba808ebb8135696 (patch)
tree2d4f25fbf928ebc38aa859391eec1cc4c4e8d0de /arch/arm/mach-imx
parentMerge tag 'samsung-fixes' of http://git.kernel.org/pub/scm/linux/kernel/git/k... (diff)
downloadkernel-qcow2-linux-d1d70e5dc2cfa9047bb935c41ba808ebb8135696.tar.gz
kernel-qcow2-linux-d1d70e5dc2cfa9047bb935c41ba808ebb8135696.tar.xz
kernel-qcow2-linux-d1d70e5dc2cfa9047bb935c41ba808ebb8135696.zip
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: afa77ef (ARM: mx3: dynamically allocate "ipu-core" devices) Signed-off-by: Emil Goode <emilgoode@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: <stable@vger.kernel.org> Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/devices/platform-ipu-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
index fc4dd7cedc11..6bd7c3f37ac0 100644
--- a/arch/arm/mach-imx/devices/platform-ipu-core.c
+++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
@@ -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)