ARM: imx: fix error handling in ipu device registration
Subsystems (3)
PATCH 1/1 ARM: imx: fix error handling in ipu device registration
From: Emil Goode <[email protected]>
If we fail to allocate struct platform_device pdev we dereference it after the goto label err.
This bug was found using coccinelle.
---
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(-)
arch/arm/mach-imx/devices/platform-ipu-core.c +1 -1
@@ -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)
Signature · 1 line
1.8.3.2
Olof Johansson
AppliedPATCH 1/1 ARM: imx: fix error handling in ipu device registration
Quoted 12 lines · Shawn Guo
From: Emil Goode <[email protected]>
If we fail to allocate struct
platform_devicepdev 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 <[email protected]>Acked-by Uwe Kleine-K?nig <[email protected]>Cc <[email protected]>Signed-off-by Shawn Guo <[email protected]>
Quoted 4 lines
---
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
PATCH 1/1 ARM: imx: fix error handling in ipu device registration
Quoted 5 lines · Olof Johansson
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