drivers: power: Replace use of devm_kzalloc instead of kzalloc
PATCH 1/1 drivers: power: Replace use of devm_kzalloc instead of kzalloc
This patch moves shared private data kzalloc to managed devm_kzalloc and so kfree is not required.
Signed-off-by Vatika Harlalka <[email protected]>
--- drivers/power/intel_mid_battery.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/power/intel_mid_battery.c +1 -2
@@ -656,7 +656,7 @@ static int probe(int irq, struct device *dev)dev_dbg (dev,"pmic-battery: found pmic battery device\n" ); - pbi =kzalloc (sizeof (*pbi),GFP_KERNEL ); + pbi =devm_kzalloc (dev,sizeof (*pbi),GFP_KERNEL );if (!pbi) {dev_err (dev,"%s(): memory allocation failed\n" , __func__);
@@ -734,7 +734,6 @@ power_reg_failed: requestirq_failed:destroy_workqueue (pbi->monitor_wqueue); wqueue_failed: -kfree (pbi);return retval; }
Signature · 1 line
1.9.1
Quoted 6 lines · Vatika Harlalka
This patch moves shared private data kzalloc to managed
devm_kzallocand so kfree is not required.Signed-off-by Vatika Harlalka <[email protected]>--- drivers/power/intel_mid_battery.c | 3 +--
I can not accept patches outside of drivers/staging/ for any outreachy application submissions, sorry. There's nothing I can do with this at this time.
Please stick with drivers/staging/* for now.
thanks,
greg k-h
Alright, I'll keep that in mind :)