Input: libps2 - fix NAK handling

Do not try to process "resend" or "reject" responses from the device
as normal response data for a command.

Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Link: https://lore.kernel.org/r/20230511185252.386941-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dmitry Torokhov 2023-05-11 11:52:44 -07:00
parent df9fe0e653
commit 1db0fd245b

View file

@ -445,7 +445,7 @@ bool ps2_handle_ack(struct ps2dev *ps2dev, u8 data)
ps2dev->flags &= ~PS2_FLAG_ACK;
wake_up(&ps2dev->wait);
if (data != PS2_RET_ACK)
if (!ps2dev->nak && data != PS2_RET_ACK)
ps2_handle_response(ps2dev, data);
return true;