ARM: imx: fix error handling in ipu device registration
authorEmil Goode <emilgoode@gmail.com>
Mon, 19 May 2014 07:07:54 +0000 (15:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jun 2014 19:03:23 +0000 (12:03 -0700)
commit6a93022f1d099b66b573aac243a4df890fd0a1c4
treec9da1116c21a4b5a11f633ec1ffb17dbe0ef4ace
parentcaf3d430ba12e30567f20950b62faa51a264ca38
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-imx/devices/platform-ipu-core.c