mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
Input: adp5588-keys - fix check on return code
commiteb017f4ea1
upstream. 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:e960309ce3
("Input: adp5588-keys - bail out on returned error") Cc: stable@vger.kernel.org Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240920-fix-adp5588-err-check-v1-1-81f6e957ef24@analog.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cd6dd564ae
commit
2a26c3122d
|
@ -627,7 +627,7 @@ static int adp5588_setup(struct adp5588_kpad *kpad)
|
|||
|
||||
for (i = 0; i < KEYP_MAX_EVENT; i++) {
|
||||
ret = adp5588_read(client, KEY_EVENTA);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user