Skip to content
Commit eba697b3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dmitry Torokhov
Browse files

Input: iqs7222 - propagate some error codes correctly



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: e505edae ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220412153954.GA15406@kili


Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent e505edae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment