]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Input: adp5588-keys - fix check on return code
authorNuno Sa <nuno.sa@analog.com>
Fri, 20 Sep 2024 07:22:52 +0000 (09:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:29:46 +0000 (16:29 +0200)
commit2a26c3122d01704450e755d022fd06d1f002cf88
tree08559b51b0c9794d44e3aa4c758b4a4134410e81
parentcd6dd564ae7d99967ef50078216929418160b30e
Input: adp5588-keys - fix check on return code

commit eb017f4ea13b1a5ad7f4332279f2e4c67b44bdea 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: e960309ce318 ("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>
drivers/input/keyboard/adp5588-keys.c