summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2023-05-11 21:52:44 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2023-05-18 21:40:32 +0300
commit1db0fd245b6016c21097b5ae01aeb447484de951 (patch)
treeb4ec0e14f5944bdc46318864195ca41d014cd2ba
parentdf9fe0e653c28756ab98f58175f8c58baf156ef1 (diff)
downloadlinux-1db0fd245b6016c21097b5ae01aeb447484de951.tar.xz
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>
-rw-r--r--drivers/input/serio/libps2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index d09450eca9a7..14b70a78875d 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -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;