diff mbox

OMAPDSS: Remove kfree for memory allocated with devm_kzalloc

Message ID 1370453396-18043-1-git-send-email-emilgoode@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Goode June 5, 2013, 5:29 p.m. UTC
It's not necessary to free memory allocated with devm_kzalloc
in a remove function and using kfree leads to a double free.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
 drivers/video/omap2/displays/panel-picodlp.c |    2 --
 1 file changed, 2 deletions(-)

Comments

archit taneja June 6, 2013, 7:10 a.m. UTC | #1
Hi,

On Wednesday 05 June 2013 10:59 PM, Emil Goode wrote:
> It's not necessary to free memory allocated with devm_kzalloc
> in a remove function and using kfree leads to a double free.

Looks fine to me. Tomi, could you take this for 3.11?

Archit

>
> Signed-off-by: Emil Goode <emilgoode@gmail.com>
> ---
>   drivers/video/omap2/displays/panel-picodlp.c |    2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c
> index 62f2db0..859e111 100644
> --- a/drivers/video/omap2/displays/panel-picodlp.c
> +++ b/drivers/video/omap2/displays/panel-picodlp.c
> @@ -469,8 +469,6 @@ static void picodlp_panel_remove(struct omap_dss_device *dssdev)
>   	i2c_unregister_device(picod->picodlp_i2c_client);
>   	dev_set_drvdata(&dssdev->dev, NULL);
>   	dev_dbg(&dssdev->dev, "removing picodlp panel\n");
> -
> -	kfree(picod);
>   }
>
>   static int picodlp_panel_enable(struct omap_dss_device *dssdev)
>

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/video/omap2/displays/panel-picodlp.c b/drivers/video/omap2/displays/panel-picodlp.c
index 62f2db0..859e111 100644
--- a/drivers/video/omap2/displays/panel-picodlp.c
+++ b/drivers/video/omap2/displays/panel-picodlp.c
@@ -469,8 +469,6 @@  static void picodlp_panel_remove(struct omap_dss_device *dssdev)
 	i2c_unregister_device(picod->picodlp_i2c_client);
 	dev_set_drvdata(&dssdev->dev, NULL);
 	dev_dbg(&dssdev->dev, "removing picodlp panel\n");
-
-	kfree(picod);
 }
 
 static int picodlp_panel_enable(struct omap_dss_device *dssdev)