summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEmil Goode <emilgoode@gmail.com>2014-05-19 15:07:54 +0800
committerBen Hutchings <ben@decadent.org.uk>2014-07-11 13:33:36 +0100
commit5b491d9bb60485ac36a4473d07e5ae9da91a7e08 (patch)
treebd9f2e5fee17666d3454a4442fb4167e0edd5bd5 /arch
parent4e6efff9b1e11c0e825a025f308a6322ca3241e5 (diff)
downloadlwn-5b491d9bb60485ac36a4473d07e5ae9da91a7e08.tar.gz
lwn-5b491d9bb60485ac36a4473d07e5ae9da91a7e08.zip
ARM: imx: fix error handling in ipu device registration
commit d1d70e5dc2cfa9047bb935c41ba808ebb8135696 upstream. 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> Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Olof Johansson <olof@lixom.net> [bwh: Backported to 3.2: adjust filename] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-mxc/devices/platform-ipu-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-ipu-core.c b/arch/arm/plat-mxc/devices/platform-ipu-core.c
index 79d340ae0af1..15f342116086 100644
--- a/arch/arm/plat-mxc/devices/platform-ipu-core.c
+++ b/arch/arm/plat-mxc/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)