public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: fix error handling in ipu device registration
@ 2014-05-19  7:07 Shawn Guo
  2014-05-22  5:18 ` Olof Johansson
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2014-05-19  7:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Emil Goode <emilgoode@gmail.com>

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>
---
Arnd, Olof,

Please consider to apply this fix for 3.15.  Thanks.

Shawn

 arch/arm/mach-imx/devices/platform-ipu-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
index fc4dd7c..6bd7c3f 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)
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] ARM: imx: fix error handling in ipu device registration
  2014-05-19  7:07 [PATCH] ARM: imx: fix error handling in ipu device registration Shawn Guo
@ 2014-05-22  5:18 ` Olof Johansson
  2014-05-22  5:33   ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Olof Johansson @ 2014-05-22  5:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 19, 2014 at 03:07:54PM +0800, Shawn Guo wrote:
> From: Emil Goode <emilgoode@gmail.com>
> 
> 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>
> ---
> Arnd, Olof,
> 
> Please consider to apply this fix for 3.15.  Thanks.

Applied, thanks.

BTW, it was requested to use a 12-character SHA in the Fixes: tag, since in the
future there might be a collision on the shortest one.

You can update the default for your git repo by setting the core.abbrevlength
config variable to 12.


-Olof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] ARM: imx: fix error handling in ipu device registration
  2014-05-22  5:18 ` Olof Johansson
@ 2014-05-22  5:33   ` Shawn Guo
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2014-05-22  5:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 21, 2014 at 10:18:50PM -0700, Olof Johansson wrote:
> BTW, it was requested to use a 12-character SHA in the Fixes: tag, since in the
> future there might be a collision on the shortest one.
> 
> You can update the default for your git repo by setting the core.abbrevlength
> config variable to 12.

Done. Thanks for the hint, Olof.

BTW, not sure what your git version is, but with my version 1.8.3.2 the
variable seems to be core.abbrev instead of core.abbrevlength, probably
because of the change below?

http://git.kaarsemaker.net/git/commit/a71f09fe3e8b047d88b5f439c6d552e8fc7e8293/

Shawn

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-22  5:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19  7:07 [PATCH] ARM: imx: fix error handling in ipu device registration Shawn Guo
2014-05-22  5:18 ` Olof Johansson
2014-05-22  5:33   ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox