Skip to content

Commit eb017f4

Browse files
nunojsadtor
authored andcommitted
Input: adp5588-keys - fix check on return code
During adp5588_setup(), we read all the events to clear the event FIFO. However, adp5588_read() just calls i2c_smbus_read_byte_data() which returns the byte read in case everything goes well. Hence, we need to explicitly check for a negative error code instead of checking for something different than 0. Fixes: e960309 ("Input: adp5588-keys - bail out on returned error") Cc: [email protected] Signed-off-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 3870e28 commit eb017f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/keyboard/adp5588-keys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static int adp5588_setup(struct adp5588_kpad *kpad)
627627

628628
for (i = 0; i < KEYP_MAX_EVENT; i++) {
629629
ret = adp5588_read(client, KEY_EVENTA);
630-
if (ret)
630+
if (ret < 0)
631631
return ret;
632632
}
633633

0 commit comments

Comments
 (0)