diff options
author | Bai Ping <b51503@freescale.com> | 2015-11-26 18:22:20 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:20:42 +0300 |
commit | c94aaf3dcb8c59995b46621a64a1ca0e78afe7b9 (patch) | |
tree | ebb01c41faac5f104cc84b95e8e2d6cdae0ae7de /drivers/cpufreq | |
parent | 92adf62fe4601c1db4564868cccd29f4b9d2d20b (diff) |
MLK-11912 cpufreq: imx: fix dereference null return value issue
After coverity code check, it reports dereference NULL return value
complain, so fix it.
Signed-off-by: Bai Ping <b51503@freescale.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 3 | ||||
-rw-r--r-- | drivers/cpufreq/imx7-cpufreq.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 09d897419fb6..04b9662e7f9e 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -229,6 +229,9 @@ static int imx6_cpufreq_pm_notify(struct notifier_block *nb, * devices may be already suspended, to avoid such scenario, * we just increase cpufreq to highest setpoint before suspend. */ + if (!data) + return NOTIFY_BAD; + switch (event) { case PM_SUSPEND_PREPARE: cpufreq_policy_min_pre_suspend = data->user_policy.min; diff --git a/drivers/cpufreq/imx7-cpufreq.c b/drivers/cpufreq/imx7-cpufreq.c index 3acd83bf7494..d5c799a0c0f9 100644 --- a/drivers/cpufreq/imx7-cpufreq.c +++ b/drivers/cpufreq/imx7-cpufreq.c @@ -135,6 +135,9 @@ static int imx7_cpufreq_pm_notify(struct notifier_block *nb, * devices may be already suspended, to avoid such scenario, * we just increase cpufreq to highest setpoint before suspend. */ + if (!data) + return NOTIFY_BAD; + switch (event) { case PM_SUSPEND_PREPARE: cpufreq_policy_min_pre_suspend = data->user_policy.min; |