cpufreq: qcom-hw: Add device NULL check in notify/polling callback

If cpu is hotplugged then policy->cpus is cleared in cpufreq_offline
which will results in device being NULL on last CPU hotplugged out.
Also since cpu is hotplugged out, polling callback can safely be
ignored in this case.

Change-Id: Ic2d29fe2bdd7c6aa1e952d700d11e321e69f6acb
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
This commit is contained in:
Vivek Aknurwar 2022-03-01 10:46:00 -08:00 committed by Mike Tipton
parent b83f18ed9a
commit 6d360fbe4b

View File

@ -361,6 +361,9 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
unsigned long freq_hz, throttled_freq;
struct dev_pm_opp *opp;
if (!dev)
return;
/*
* Get the h/w throttled frequency, normalize it using the
* registered opp table and use it to calculate thermal pressure.