Skip to content
Commit 7ddd8deb authored by Manivannan Sadhasivam's avatar Manivannan Sadhasivam Committed by Viresh Kumar
Browse files

OPP: Fix potential null ptr dereference in dev_pm_opp_get_required_pstate()



"opp" pointer is dereferenced before the IS_ERR_OR_NULL() check. Fix it by
removing the dereference to cache opp_table and dereference it directly
where opp_table is used.

This fixes the following smatch warning:

drivers/opp/core.c:232 dev_pm_opp_get_required_pstate() warn: variable
dereferenced before IS_ERR check 'opp' (see line 230)

Fixes: 84cb7ff3 ("OPP: pstate is only valid for genpd OPP tables")
Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 746de825
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment