From: Jeff LaBundy <jeff@labundy.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Input: iqs7222 - propagate some error codes correctly
Date: Sun, 17 Apr 2022 15:10:33 -0500 [thread overview]
Message-ID: <20220417201033.GA197290@nixie71> (raw)
In-Reply-To: <Ylxy0fnZ0lNSWzxh@google.com>
Hi Dan,
On Sun, Apr 17, 2022 at 01:04:33PM -0700, Dmitry Torokhov wrote:
> On Tue, Apr 12, 2022 at 06:39:54PM +0300, Dan Carpenter wrote:
> > If fwnode_property_count_u32() returns a negative error code then,
> > because of type promotion, the "count > ARRAY_SIZE(pins)" condition
> > will be true. The negative "count" is type promoted to a high unsigned
> > size_t value.
> >
> > That means the "else if (count < 0)" condition will always be false and
> > we don't print that error message or propagate the error code from
> > fwnode_property_count_u32() as intended.
> >
> > Fix this by re-ordering the checks so that we check for negative first.
> >
> > Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
A bit late on my part, but for what it's worth:
Acked-by: Jeff LaBundy <jeff@labundy.com>
Thanks for sending this; it's a great catch.
>
> Applied, thank you.
>
> --
> Dmitry
Kind regards,
Jeff LaBundy
prev parent reply other threads:[~2022-04-17 20:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 15:39 [PATCH] Input: iqs7222 - propagate some error codes correctly Dan Carpenter
2022-04-17 20:04 ` Dmitry Torokhov
2022-04-17 20:10 ` Jeff LaBundy [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=20220417201033.GA197290@nixie71 \
--to=jeff@labundy.com \
--cc=dan.carpenter@oracle.com \
--cc=dmitry.torokhov@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).