Skip to content

Commit 306d5ac

Browse files
Pan Zhangbentiss
authored andcommitted
drivers/hid/hid-multitouch.c: fix a possible null pointer access.
1002 if ((quirks & MT_QUIRK_IGNORE_DUPLICATES) && mt) { 1003 struct input_mt_slot *i_slot = &mt->slots[slotnum]; 1004 1005 if (input_mt_is_active(i_slot) && 1006 input_mt_is_used(mt, i_slot)) 1007 return -EAGAIN; 1008 } We previously assumed 'mt' could be null (see line 1002). The following situation is similar, so add a judgement. Signed-off-by: Pan Zhang <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent fe4e940 commit 306d5ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static int mt_process_slot(struct mt_device *td, struct input_dev *input,
10191019
tool = MT_TOOL_DIAL;
10201020
else if (unlikely(!confidence_state)) {
10211021
tool = MT_TOOL_PALM;
1022-
if (!active &&
1022+
if (!active && mt &&
10231023
input_mt_is_active(&mt->slots[slotnum])) {
10241024
/*
10251025
* The non-confidence was reported for

0 commit comments

Comments
 (0)