public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver
@ 2022-06-13 11:13 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-06-13 11:13 UTC (permalink / raw)
  To: johnson.wang; +Cc: linux-pm, linux-mediatek

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-13 12:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-13 11:13 [bug report] PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox