]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq/longhaul: handle NULL policy in longhaul_exit
authorDennis Beier <nanovim@gmail.com>
Sat, 30 Aug 2025 14:43:59 +0000 (16:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:07 +0000 (12:45 +0100)
commitb02352dd2e6cca98777714cc2a27553191df70db
treeff0e9011d9bcddb02aa9f7a9e0eaeca74c4a2104
parentb5d562b4d42646e9d89dfb3c9dece94d3b4be247
cpufreq/longhaul: handle NULL policy in longhaul_exit

[ Upstream commit 592532a77b736b5153e0c2e4c74aa50af0a352ab ]

longhaul_exit() was calling cpufreq_cpu_get(0) without checking
for a NULL policy pointer. On some systems, this could lead to a
NULL dereference and a kernel warning or panic.

This patch adds a check using unlikely() and returns early if the
policy is NULL.

Bugzilla: #219962

Signed-off-by: Dennis Beier <nanovim@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/longhaul.c