Re: [PATCH] Input: iqs7222 - propagate some error codes correctly

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

 



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@xxxxxxxxxx>

A bit late on my part, but for what it's worth:

Acked-by: Jeff LaBundy <jeff@xxxxxxxxxxx>

Thanks for sending this; it's a great catch.

> 
> Applied, thank you.
> 
> -- 
> Dmitry

Kind regards,
Jeff LaBundy



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux