public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / devfreq: Fix leak in devfreq_dev_release()
@ 2023-08-09 11:31 Boris Brezillon
  2023-08-10  5:21 ` Dhruva Gole
  2023-08-10 13:50 ` Chanwoo Choi
  0 siblings, 2 replies; 4+ messages in thread
From: Boris Brezillon @ 2023-08-09 11:31 UTC (permalink / raw)
  To: MyungJoo Ham, Kyungmin Park, Chanwoo Choi, linux-pm
  Cc: Boris Brezillon, stable

srcu_init_notifier_head() allocates resources that need to be released
with a srcu_cleanup_notifier_head() call.

Reported by kmemleak.

Fixes: 0fe3a66410a3 ("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/devfreq/devfreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index e36cbb920ec8..9464f8d3cb5b 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -763,6 +763,7 @@ static void devfreq_dev_release(struct device *dev)
 		dev_pm_opp_put_opp_table(devfreq->opp_table);
 
 	mutex_destroy(&devfreq->lock);
+	srcu_cleanup_notifier_head(&devfreq->transition_notifier_list);
 	kfree(devfreq);
 }
 
-- 
2.41.0


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

end of thread, other threads:[~2023-08-10 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09 11:31 [PATCH] PM / devfreq: Fix leak in devfreq_dev_release() Boris Brezillon
2023-08-10  5:21 ` Dhruva Gole
2023-08-10  6:49   ` Boris Brezillon
2023-08-10 13:50 ` Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox