PM / devfreq: Fix leak in devfreq_dev_release()
commit 5693d077595de721f9ddbf9d37f40e5409707dfe upstream.
srcu_init_notifier_head() allocates resources that need to be released
with a srcu_cleanup_notifier_head() call.
Reported by kmemleak.
Fixes: 0fe3a66410
("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3e39008e9e
commit
ab192e5e5d
@ -732,6 +732,7 @@ static void devfreq_dev_release(struct device *dev)
|
||||
devfreq->profile->exit(devfreq->dev.parent);
|
||||
|
||||
mutex_destroy(&devfreq->lock);
|
||||
srcu_cleanup_notifier_head(&devfreq->transition_notifier_list);
|
||||
kfree(devfreq);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user