diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-04-17 23:03:53 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2022-04-17 23:14:29 +0300 |
commit | eba697b3c30320933aeb19b0606c2099fe880e51 (patch) | |
tree | 6a703a35bdd9cca9d9441fc56c6f7d2b89e91227 /security | |
parent | e505edaedcb9e7d16eefddc62d2189afaea0febc (diff) | |
download | linux-eba697b3c30320933aeb19b0606c2099fe880e51.tar.xz |
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: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220412153954.GA15406@kili
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions