diff options
author | Sukrut Bellary <sukrut.bellary@linux.com> | 2023-05-18 10:40:33 +0200 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2023-05-29 16:25:31 +0200 |
commit | a83bfdca8b2098999e3edfb87e98925e019eb818 (patch) | |
tree | 0c1732edebb9bb075168b24f081dd4e1d17a9f3c /drivers/devfreq | |
parent | PM / devfreq: exynos: add Exynos PPMU as a soft module dependency (diff) | |
download | linux-a83bfdca8b2098999e3edfb87e98925e019eb818.tar.xz linux-a83bfdca8b2098999e3edfb87e98925e019eb818.zip |
PM / devfreq: mtk-cci: Fix variable deferencing before NULL check
smatch warning:
drivers/devfreq/mtk-cci-devfreq.c:135 mtk_ccifreq_target()
warn: variable dereferenced before check 'drv' (see line 130)
This is based on static analysis only. Compilation tested.
Signed-off-by: Sukrut Bellary <sukrut.bellary@linux.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r-- | drivers/devfreq/mtk-cci-devfreq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/devfreq/mtk-cci-devfreq.c b/drivers/devfreq/mtk-cci-devfreq.c index e5458ada5197..6354622eda65 100644 --- a/drivers/devfreq/mtk-cci-devfreq.c +++ b/drivers/devfreq/mtk-cci-devfreq.c @@ -127,7 +127,7 @@ static int mtk_ccifreq_target(struct device *dev, unsigned long *freq, u32 flags) { struct mtk_ccifreq_drv *drv = dev_get_drvdata(dev); - struct clk *cci_pll = clk_get_parent(drv->cci_clk); + struct clk *cci_pll; struct dev_pm_opp *opp; unsigned long opp_rate; int voltage, pre_voltage, inter_voltage, target_voltage, ret; @@ -139,6 +139,7 @@ static int mtk_ccifreq_target(struct device *dev, unsigned long *freq, return 0; inter_voltage = drv->inter_voltage; + cci_pll = clk_get_parent(drv->cci_clk); opp_rate = *freq; opp = devfreq_recommended_opp(dev, &opp_rate, 1); |