Skip to content
Commit ee46967f authored by Peter Hutterer's avatar Peter Hutterer Committed by Jiri Kosina
Browse files

HID: core: replace the collection tree pointers with indices

Previously, the pointer to the parent collection was stored. If a device
exceeds 16 collections (HID_DEFAULT_NUM_COLLECTIONS), the array to store
the collections is reallocated, the pointer to the parent collection becomes
invalid.

Replace the pointers with an index-based lookup into the collections array.

Fixes: c53431eb

 ("HID: core: store the collections as a basic tree")
Reported-by: default avatarPandruvada, Srinivas <srinivas.pandruvada@intel.com>
Signed-off-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
Tested-by: default avatarKyle Pelton <kyle.d.pelton@linux.intel.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent cf26057a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment