]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: exit() callback is optional
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 12 Apr 2024 05:49:20 +0000 (11:19 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:21 +0000 (13:39 +0200)
commit35db5e76d5e9f752476df5fa0b9018a2398b0378
tree0e41a4e12abda1ec1658f7f4cb6d549daeb17c83
parent43b27f9714bd5330d891695740c553cbf226e760
cpufreq: exit() callback is optional

[ Upstream commit b8f85833c05730d631576008daaa34096bc7f3ce ]

The exit() callback is optional and shouldn't be called without checking
a valid pointer first.

Also, we must clear freq_table pointer even if the exit() callback isn't
present.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Fixes: 91a12e91dc39 ("cpufreq: Allow light-weight tear down and bring up of CPUs")
Fixes: f339f3541701 ("cpufreq: Rearrange locking in cpufreq_remove_dev()")
Reported-by: Lizhe <sensor1010@163.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/cpufreq.c