]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PM / devfreq: Lock devfreq in trans_stat_show
authorLeonard Crestez <leonard.crestez@nxp.com>
Tue, 24 Sep 2019 07:52:23 +0000 (10:52 +0300)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 6 Nov 2019 03:04:00 +0000 (12:04 +0900)
commit2abb0d5268ae7b5ddf82099b1f8d5aa8414637d4
tree3c6991f0a3e90ac554a58d23bcfd6cddb14928bf
parentd68adc8f85cd757bd33c8d7b2660ad6f16f7f3dc
PM / devfreq: Lock devfreq in trans_stat_show

There is no locking in this sysfs show function so stats printing can
race with a devfreq_update_status called as part of freq switching or
with initialization.

Also add an assert in devfreq_update_status to make it clear that lock
must be held by caller.

Fixes: 39688ce6facd ("PM / devfreq: account suspend/resume for stats")
Cc: stable@vger.kernel.org
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/devfreq.c