From: Linus Walleij <linus.walleij@linaro.org>
To: Dan Carpenter <error27@gmail.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [bug report] iio: adc: add a driver for Qualcomm PM8xxx HK/XOADC
Date: Thu, 23 Mar 2023 09:11:37 +0100 [thread overview]
Message-ID: <CACRpkdaiFkgEmbfUHmmr8J6afcr-W4ngtcVUwbAZn+KsumG+pg@mail.gmail.com> (raw)
In-Reply-To: <02034937-12e2-44f5-8311-10d960dc7dc4@kili.mountain>
On Wed, Mar 22, 2023 at 10:09 AM Dan Carpenter <error27@gmail.com> 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@gmail.com/
It seems the other static checker also found it now...
Yours,
Linus Walleij
prev parent reply other threads:[~2023-03-23 8:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 9:09 [bug report] iio: adc: add a driver for Qualcomm PM8xxx HK/XOADC Dan Carpenter
2023-03-23 8:11 ` Linus Walleij [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACRpkdaiFkgEmbfUHmmr8J6afcr-W4ngtcVUwbAZn+KsumG+pg@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=error27@gmail.com \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.