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

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

 



On Wed, Mar 22, 2023 at 10:09 AM Dan Carpenter <error27@xxxxxxxxx> wrote:

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

:D

> 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)
>
> drivers/iio/adc/qcom-pm8xxx-xoadc.c
>    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.

Actually there was a patch for this last week:
https://lore.kernel.org/linux-iio/20230314193709.15208-1-xhxgldhlpfy@xxxxxxxxx/

It seems the other static checker also found it now...

Yours,
Linus Walleij




[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