]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
drivers/hid/hid-multitouch.c: fix a possible null pointer access.
authorPan Zhang <zhangpan26@huawei.com>
Thu, 19 Dec 2019 02:45:30 +0000 (10:45 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:52:39 +0000 (00:52 -0400)
commit61591ac3247663ee9e51b0068ae798feb8650e9a
tree792ab51e188e3df9ceeb1fe8992100a2fb67c66a
parent556aa07247cf3e3bd75270f4863e46ddadab98ff
drivers/hid/hid-multitouch.c: fix a possible null pointer access.

BugLink: https://bugs.launchpad.net/bugs/1866403
[ Upstream commit 306d5acbfc66e7cccb4d8f91fc857206b8df80d1 ]

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 <zhangpan26@huawei.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/hid-multitouch.c