]> git.baikalelectronics.ru Git - kernel.git/commit
i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 27 Oct 2018 16:10:48 +0000 (09:10 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 27 Oct 2018 16:10:48 +0000 (09:10 -0700)
commit3394bef37ce69cec405a8314ba47b7d61e2b68bf
tree20c0be33676ac6afe5efbeb4426c4a92f2aa4bbe
parent5cc61d1dc5f4f20275d007a86b42ee326666ca08
i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array

Commit 0035ad39f7e5 ("HID: i2c-hid: override HID descriptors for certain
devices") added a new dmi_system_id quirk table to override certain HID
report descriptors for some systems that lack them.

But the table wasn't properly terminated, causing the dmi matching to
walk off into la-la-land, and starting to treat random data as dmi
descriptor pointers, causing boot-time oopses if you were at all
unlucky.

Terminate the array.

We really should have some way to just statically check that arrays that
should be terminated by an empty entry actually are so.  But the HID
people really should have caught this themselves, rather than have me
deal with an oops during the merge window.  Tssk, tssk.

Cc: Julian Sax <jsbc@gmx.de>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c