Commit 5693d077 authored by Boris Brezillon's avatar Boris Brezillon Committed by Chanwoo Choi
Browse files

PM / devfreq: Fix leak in devfreq_dev_release()



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

Reported by kmemleak.

Fixes: 0fe3a664 ("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: default avatarDhruva Gole <d-gole@ti.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent c46de2fb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -764,6 +764,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);
}