Skip to contentSkip to conversation

input: touchscreen: Add NULL pointer check before dereference

PATCH Saiyam Doshi 2 participants 2 messages Oct 24, 2019 – Oct 25, 2019 1 message not in the archive HID

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 5 lines · Saiyam Doshi

In sx8654_probe function, if call to device_get_match_data() return NULL, it dereferences driver_data from 'id'.

To avoid NULL pointer dereference, add check to make sure 'id' is not NULL.

Any review / update on this?

-Saiyam

#2 lore raw

Hi Saiyam,

Quoted 8 lines · Saiyam Doshi
Quoted 5 lines · Saiyam Doshi

In sx8654_probe function, if call to device_get_match_data() return NULL, it dereferences driver_data from 'id'.

To avoid NULL pointer dereference, add check to make sure 'id' is not NULL.

Any review / update on this?

Can you please explain under what circumstances we can get NULL from device_get_match_data() in this driver?

Thanks.

Signature · 1 line
Dmitry