Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: sur40 - convert le16 to cpu before use

Smatch found this issue:
drivers/input/touchscreen/sur40.c:424:55: warning: incorrect type in argument 2 (different base types)
drivers/input/touchscreen/sur40.c:424:55: expected int key
drivers/input/touchscreen/sur40.c:424:55: got restricted __le16 [usertype] blob_id

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20240410-smatch-v1-6-785d009a852b@chromium.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Ricardo Ribalda and committed by
Dmitry Torokhov
ba2ec9c4 8984e0b5

+1 -1
+1 -1
drivers/input/touchscreen/sur40.c
··· 421 421 if (blob->type != SUR40_TOUCH) 422 422 return; 423 423 424 - slotnum = input_mt_get_slot_by_key(input, blob->blob_id); 424 + slotnum = input_mt_get_slot_by_key(input, le16_to_cpu(blob->blob_id)); 425 425 if (slotnum < 0 || slotnum >= MAX_CONTACTS) 426 426 return; 427 427