Skip to contentSkip to conversation

power: 88pm860x: fix invalid free of devm_* allocated data

PATCH In review Silviu-Mihai Popescu 2 participants 2 messages Mar 17, 2013 – Apr 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: 88pm860x: fix invalid free of devm_* allocated data

The objects allocated by devm_* APIs are managed by devres and are freed when the device is detached. There is no need to use kfree() explicitly.

---
 drivers/power/88pm860x_charger.c |    1 -
 1 file changed, 1 deletion(-)
drivers/power/88pm860x_charger.c +0 -1
index 4b37a5a..d7ceeac 100644
@@ -714,7 +714,6 @@ out_irq:
 	while (--i >= 0)
 		free_irq(info->irq[i], info);
 out:
-	kfree(info);
 	return ret;
 }
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 5 lines · Silviu-Mihai Popescu

The objects allocated by devm_* APIs are managed by devres and are freed when the device is detached. There is no need to use kfree() explicitly.

---

Jingoo Han sent a similar patch earlier...

Anyway, thanks!

Anton