Skip to contentSkip to conversation

driver core: location: Free struct acpi_pld_info *pld

PATCH In review Won Chung 2 participants 3 messages May 9, 2022 – May 19, 2022 Driver core

lore
Share & tools
lore

Won Chung

author
#0 lore raw

PATCH 1/1 driver core: location: Free struct acpi_pld_info *pld

After struct acpi_pld_info *pld is used to fill in physical location values, it should be freed to prevent memleak.

---
 drivers/base/physical_location.c | 1 +
 1 file changed, 1 insertion(+)
drivers/base/physical_location.c +1 -0
index fbd9f9839e92..617ada542b00 100644
@@ -32,6 +32,7 @@ bool dev_add_physical_location(struct device *dev)
 	dev->physical_location->dock = pld->dock;
 	dev->physical_location->lid = pld->lid;
 
+	ACPI_FREE(pld);
 	return true;
 }
 
Signature · 1 line
2.36.0.512.ge40c2bad7a-goog
#1 lore raw
Quoted 24 lines · Won Chung

After struct acpi_pld_info *pld is used to fill in physical location values, it should be freed to prevent memleak.

---
 drivers/base/physical_location.c | 1 +
 1 file changed, 1 insertion(+)
drivers/base/physical_location.c +1 -0
index fbd9f9839e92..617ada542b00 100644
@@ -32,6 +32,7 @@ bool dev_add_physical_location(struct device *dev)
 	dev->physical_location->dock = pld->dock;
 	dev->physical_location->lid = pld->lid;
 
+	ACPI_FREE(pld);
 	return true;
 }
 
Signature · 1 line
2.36.0.512.ge40c2bad7a-goog

What commit id does this fix? Please add that and resend.

thanks,
greg k-h

#2 lore raw
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Won Chung

After struct acpi_pld_info *pld is used to fill in physical location values, it should be freed to prevent memleak.

---
 drivers/base/physical_location.c | 1 +
 1 file changed, 1 insertion(+)
drivers/base/physical_location.c +1 -0
index fbd9f9839e92..617ada542b00 100644
@@ -32,6 +32,7 @@ bool dev_add_physical_location(struct device *dev)
 	dev->physical_location->dock = pld->dock;
 	dev->physical_location->lid = pld->lid;
 
+	ACPI_FREE(pld);
 	return true;
 }
 
Quoted 8 lines
Quoted 3 lines
Signature · 1 line
2.36.0.512.ge40c2bad7a-goog

What commit id does this fix? Please add that and resend.

thanks,
greg k-h

Nevermind, I'll take it as-is.