On Sat, Jul 25, 2026 at 04:09:47PM +0800, Liang Zhan wrote:
The current code checks the raw register value against zero to detect an
empty FIFO. However, the TCA8418 datasheet defines key code 0 as the
empty-FIFO condition. If the hardware returns garbage data, the loop may
never terminate and the extracted keycode can cause an out-of-bounds access
on keymap[].
Move the empty-FIFO check to operate on the extracted key code so that
the loop terminates correctly. Additionally, validate row/column indices
against the configured matrix dimensions before indexing into the
keymap array, skipping invalid events.
Unfortunately your mailer line-wrapped the patch so it does not apply.
Thanks.
--
Dmitry