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

A message that is not in the archive (sent off-list or not yet received): 20190901182309.GA5574@ahmlpt0706

#1 lore raw
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