All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver core: location: Free struct acpi_pld_info *pld
@ 2022-05-09 17:31 Won Chung
  2022-05-19 16:51 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Won Chung @ 2022-05-09 17:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Yu Watanabe, linux-kernel
  Cc: Rafael J . Wysocki, Won Chung

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

Suggested-by: Yu Watanabe <watanabe.yu@gmail.com>
Signed-off-by: Won Chung <wonchung@google.com>
---
 drivers/base/physical_location.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/base/physical_location.c b/drivers/base/physical_location.c
index fbd9f9839e92..617ada542b00 100644
--- a/drivers/base/physical_location.c
+++ b/drivers/base/physical_location.c
@@ -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;
 }
 
-- 
2.36.0.512.ge40c2bad7a-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-19 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 17:31 [PATCH] driver core: location: Free struct acpi_pld_info *pld Won Chung
2022-05-19 16:51 ` Greg Kroah-Hartman
2022-05-19 16:51   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.