Skip to content

Commit

Permalink
PM / devfreq: Fix leak in devfreq_dev_release()
Browse files Browse the repository at this point in the history
srcu_init_notifier_head() allocates resources that need to be released
with a srcu_cleanup_notifier_head() call.

Reported by kmemleak.

Fixes: 0fe3a66 ("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier")
Cc: <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Dhruva Gole <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
  • Loading branch information
bbrezillon authored and chanwoochoi committed Aug 10, 2023
1 parent c46de2f commit 5693d07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5693d07

Please sign in to comment.