]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Input: iqs7222 - avoid sending empty SYN_REPORT events
authorJeff LaBundy <jeff@labundy.com>
Thu, 8 Sep 2022 21:24:24 +0000 (14:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:50 +0000 (13:26 +0100)
[ Upstream commit 514c13b1faed74e9bc19061b6d7c78d53a3402ba ]

Add a check to prevent sending undefined events, which ultimately
map to SYN_REPORT.

Fixes: e505edaedcb9 ("Input: add support for Azoteq IQS7222A/B/C")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20220908131548.48120-7-jeff@labundy.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/misc/iqs7222.c

index 8fd665874a245f230144c4f30058621826c2e723..0b2bf471b3a0fb04055da3fcab750f144ddfba14 100644 (file)
@@ -2314,6 +2314,9 @@ static int iqs7222_report(struct iqs7222_private *iqs7222)
                        int k = 2 + j * (num_chan > 16 ? 2 : 1);
                        u16 state = le16_to_cpu(status[k + i / 16]);
 
+                       if (!iqs7222->kp_type[i][j])
+                               continue;
+
                        input_event(iqs7222->keypad,
                                    iqs7222->kp_type[i][j],
                                    iqs7222->kp_code[i][j],