public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] regulator: axp20x: add support for set_ramp_delay for AXP209
@ 2018-12-15  9:41 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-12-15  9:41 UTC (permalink / raw)
  To: kernel-janitors

Hello Olliver Schinagl,

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

The patch d29f54df8b16: "regulator: axp20x: add support for 
set_ramp_delay for AXP209" from Dec 11, 2018, leads to the following 
Smatch complaint:

    drivers/regulator/axp20x-regulator.c:375 axp20x_set_ramp_delay()
    warn: variable dereferenced before check 'rdev' (see line 369)

drivers/regulator/axp20x-regulator.c
   368	{
   369		struct axp20x_dev *axp20x = rdev_get_drvdata(rdev);
                                                             ^^^^
   370		const struct regulator_desc *desc = rdev->desc;
                                                    ^^^^^^^^^^
Dereferences

   371		u8 reg, mask, enable, cfg = 0xff;
   372		const int *slew_rates;
   373		int rate_count = 0;
   374	
   375		if (!rdev)
                    ^^^^^
Check too late.

   376			return -EINVAL;
   377	

regards,
dan carpenter

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

only message in thread, other threads:[~2018-12-15  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-15  9:41 [bug report] regulator: axp20x: add support for set_ramp_delay for AXP209 Dan Carpenter

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