Skip to contentSkip to conversation

eeprom: idt_89hpesx: Discard memory freeing allocated by devm_kmalloc

PATCH New Serge Semin 1 participant 1 message Jan 26, 2017 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eeprom: idt_89hpesx: Discard memory freeing allocated by devm_kmalloc

Indeed, the data structure is allocated by device resource manager, so the driver doesn't need to free anything on remove() callback.

---
 drivers/misc/eeprom/idt_89hpesx.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/misc/eeprom/idt_89hpesx.c +0 -3
index 25d47d0..f73fd04 100644
@@ -1227,9 +1227,6 @@ static void idt_free_pdev(struct idt_89hpesx_dev *pdev)
 {
 	/* Clear driver data from device private field */
 	i2c_set_clientdata(pdev->client, NULL);
-
-	/* Just free memory allocated for data */
-	devm_kfree(&pdev->client->dev, pdev);
 }
 
 /*
Signature · 1 line
2.6.6