Skip to contentSkip to conversation

OMAPDSS: Remove kfree for memory allocated with devm_kzalloc

PATCH In review Emil Goode 2 participants 2 messages Jun 5, 2013 – Jun 6, 2013

Subsystems (2)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH 1/1 OMAPDSS: Remove kfree for memory allocated with devm_kzalloc

It's not necessary to free memory allocated with devm_kzalloc in a remove function and using kfree leads to a double free.

---
 drivers/video/omap2/displays/panel-picodlp.c |    2 --
 1 file changed, 2 deletions(-)
drivers/video/omap2/displays/panel-picodlp.c +0 -2
index 62f2db0..859e111 100644
@@ -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)
Signature · 1 line
1.7.10.4
#1 lore raw

Hi,

Quoted 2 lines · Emil Goode

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

Quoted 20 lines
---
  drivers/video/omap2/displays/panel-picodlp.c |    2 --
  1 file changed, 2 deletions(-)
drivers/video/omap2/displays/panel-picodlp.c +0 -2
index 62f2db0..859e111 100644
@@ -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)