Re: [PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration

2014-05-19 Thread Shawn Guo
On Mon, May 19, 2014 at 08:31:45AM +0200, Uwe Kleine-König wrote:
> On Sun, May 18, 2014 at 10:50:59PM +0200, Emil Goode wrote:
> > If we fail to allocate struct platform_device pdev we
> > dereference it after the goto label err.
> > 
> > This bug was found using coccinelle.
> > 
> > Signed-off-by: Emil Goode 
> Acked-by: Uwe Kleine-König 
> 
> Shawn, is it already to late for 3.15?

Let me try to see.

Shawn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration

2014-05-19 Thread Uwe Kleine-König
On Sun, May 18, 2014 at 10:50:59PM +0200, Emil Goode wrote:
> If we fail to allocate struct platform_device pdev we
> dereference it after the goto label err.
> 
> This bug was found using coccinelle.
> 
> Signed-off-by: Emil Goode 
Acked-by: Uwe Kleine-König 

Shawn, is it already to late for 3.15?

Thanks
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration

2014-05-19 Thread Uwe Kleine-König
On Sun, May 18, 2014 at 10:50:59PM +0200, Emil Goode wrote:
 If we fail to allocate struct platform_device pdev we
 dereference it after the goto label err.
 
 This bug was found using coccinelle.
 
 Signed-off-by: Emil Goode emilgo...@gmail.com
Acked-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de

Shawn, is it already to late for 3.15?

Thanks
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration

2014-05-19 Thread Shawn Guo
On Mon, May 19, 2014 at 08:31:45AM +0200, Uwe Kleine-König wrote:
 On Sun, May 18, 2014 at 10:50:59PM +0200, Emil Goode wrote:
  If we fail to allocate struct platform_device pdev we
  dereference it after the goto label err.
  
  This bug was found using coccinelle.
  
  Signed-off-by: Emil Goode emilgo...@gmail.com
 Acked-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
 
 Shawn, is it already to late for 3.15?

Let me try to see.

Shawn
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration

2014-05-18 Thread Emil Goode
If we fail to allocate struct platform_device pdev we
dereference it after the goto label err.

This bug was found using coccinelle.

Signed-off-by: Emil Goode 
---
v4: Simplified version that just fixes the bug.
Also updated the changelog.
v3: Made subject line more specific.
v2: Changed to return -ENOMEM instead of ret where possible and
updated the subject line.

 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.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration

2014-05-18 Thread Emil Goode
If we fail to allocate struct platform_device pdev we
dereference it after the goto label err.

This bug was found using coccinelle.

Signed-off-by: Emil Goode emilgo...@gmail.com
---
v4: Simplified version that just fixes the bug.
Also updated the changelog.
v3: Made subject line more specific.
v2: Changed to return -ENOMEM instead of ret where possible and
updated the subject line.

 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.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/