[bug report] iio: adc: add a driver for Qualcomm PM8xxx HK/XOADC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


[ No idea why this warning is showing up after 6 years. -dan ]

Hello Linus Walleij,

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

The patch 63c3ecd946d4: "iio: adc: add a driver for Qualcomm PM8xxx
HK/XOADC" from Apr 4, 2017, leads to the following Smatch complaint:

    drivers/iio/adc/qcom-pm8xxx-xoadc.c:769 pm8xxx_xoadc_parse_channel()
    error: we previously assumed 'hwchan' could be null (see line 761)

   760		hwchan = &hw_channels[0];

Here the hw_channels is variant->channels so it potentially is NULL
(maybe?  I don't know the context very well).

   761		while (hwchan && hwchan->datasheet_name) {
Check for NULL.

   762			if (hwchan->pre_scale_mux == pre_scale_mux &&
   763			    hwchan->amux_channel == amux_channel)
   764				break;
   765			hwchan++;
   766			chid++;
   767		}
   768		/* The sentinel does not have a name assigned */
   769		if (!hwchan->datasheet_name) {
Unchecked dereference.

   770			dev_err(dev, "could not locate channel %02x/%02x\n",
   771				pre_scale_mux, amux_channel);

dan carpenter

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux