linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM: energy_model: Replace kfree() with em_table_free()
@ 2025-10-13  9:16 Kaushlendra Kumar
  2025-10-14 11:01 ` Christian Loehle
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushlendra Kumar @ 2025-10-13  9:16 UTC (permalink / raw)
  To: lukasz.luba, rafael, pavel; +Cc: linux-pm, Kaushlendra Kumar

Replace kfree() with em_table_free() for error path of em_create_pd()
to ensure proper cleanup of energy model tables. The em_table_free()
function provides the correct deallocation mechanism for energy model
table structures, ensuring consistent memory management throughout the
energy model subsystem.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
---
 kernel/power/energy_model.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 5f17d2e8e954..e8ae1f518b8a 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -441,7 +441,7 @@ static int em_create_pd(struct device *dev, int nr_states,
 	return 0;
 
 free_pd_table:
-	kfree(em_table);
+	em_table_free(em_table);
 free_pd:
 	kfree(pd);
 	return -EINVAL;
-- 
2.34.1


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

end of thread, other threads:[~2025-10-14 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13  9:16 [PATCH] PM: energy_model: Replace kfree() with em_table_free() Kaushlendra Kumar
2025-10-14 11:01 ` Christian Loehle
2025-10-14 12:43   ` Lukasz Luba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).