Skip to contentSkip to conversation

mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc

PATCH New Wei Yongjun 2 participants 3 messages Apr 27, 2020 – Apr 28, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc

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

---
 drivers/mfd/wcd934x.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mfd/wcd934x.c +0 -1
index 90341f3c6810..da910302d51a 100644
@@ -280,7 +280,6 @@ static void wcd934x_slim_remove(struct slim_device *sdev)
 
 	regulator_bulk_disable(WCD934X_MAX_SUPPLY, ddata->supplies);
 	mfd_remove_devices(&sdev->dev);
-	kfree(ddata);
 }
 
 static const struct slim_device_id wcd934x_slim_id[] = {
#1 lore raw

PATCH 1/1 mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc

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

Fixes 6ac7e4d7ad70 ("mfd: wcd934x: Add support to wcd9340/wcd9341 codec")
---
 drivers/mfd/wcd934x.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mfd/wcd934x.c +0 -1
index 90341f3c6810..da910302d51a 100644
@@ -280,7 +280,6 @@ static void wcd934x_slim_remove(struct slim_device *sdev)
 
 	regulator_bulk_disable(WCD934X_MAX_SUPPLY, ddata->supplies);
 	mfd_remove_devices(&sdev->dev);
-	kfree(ddata);
 }
 
 static const struct slim_device_id wcd934x_slim_id[] = {
Applied
#2 lore raw
Quoted 8 lines · Wei Yongjun

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

Fixes 6ac7e4d7ad70 ("mfd: wcd934x: Add support to wcd9340/wcd9341 codec")
---
 drivers/mfd/wcd934x.c | 1 -
 1 file changed, 1 deletion(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog