]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PM / devfreq: Check governor before using governor->name
authorLifeng Zheng <zhenglifeng1@huawei.com>
Mon, 21 Apr 2025 03:00:20 +0000 (11:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:04:55 +0000 (12:04 +0200)
commit631e101728df2a86b8fb761b49fad9712c651f8a
tree0faa7d431fc348379b915a7cc0491779288681e1
parentfdbce5ec3928e90b6cd8fecb711a5269a2477606
PM / devfreq: Check governor before using governor->name

[ Upstream commit bab7834c03820eb11269bc48f07c3800192460d2 ]

Commit 96ffcdf239de ("PM / devfreq: Remove redundant governor_name from
struct devfreq") removes governor_name and uses governor->name to replace
it. But devfreq->governor may be NULL and directly using
devfreq->governor->name may cause null pointer exception. Move the check of
governor to before using governor->name.

Fixes: 96ffcdf239de ("PM / devfreq: Remove redundant governor_name from struct devfreq")
Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Link: https://lore.kernel.org/lkml/20250421030020.3108405-5-zhenglifeng1@huawei.com/
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/devfreq/devfreq.c