lkml.org 
[lkml]   [2014]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.11 32/93] ARM: imx: fix error handling in ipu device registration
    Date
    3.11.10.12 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Emil Goode <emilgoode@gmail.com>

    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: Luis Henriques <luis.henriques@canonical.com>
    ---
    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 fc4dd7cedc11..6bd7c3f37ac0 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.9.1
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2014-06-23 15:41    [W:4.365 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site