Skip to contentSkip to conversation

PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver

bug report Dan Carpenter 1 participant 1 message Jun 13, 2022 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

Hello Johnson Wang,

This is a semi-automatic email about new static checker warnings.

The patch 9f3ec0f65421: "PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver" from Jun 7, 2022, leads to the following Smatch complaint:

drivers/devfreq/mtk-cci-devfreq.c:135 mtk_ccifreq_target()
warn: variable dereferenced before check 'drv' (see line 130)

drivers/devfreq/mtk-cci-devfreq.c
129 struct mtk_ccifreq_drv *drv = dev_get_drvdata(dev);

   130		struct clk *cci_pll = clk_get_parent(drv->cci_clk);
                                                     ^^^^^^^^^^^^

Dereference

131 struct dev_pm_opp *opp;
132 unsigned long opp_rate;
133 int voltage, pre_voltage, inter_voltage, target_voltage, ret;
134
135 if (!drv)

                    ^^^^

Checked too late.

136 return -EINVAL;
137

regards,
dan carpenter

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek