HID: hidraw: Add spinlock in struct hidraw to protect list
It is unsafe to call list_for_each_entry in hidraw_report_event to
traverse each hidraw_list node without a lock protection, the list
could be modified if someone calls hidraw_release and list_del to
remove itself from the list, this can cause hidraw_report_event
to touch a deleted list struct and panic.
To prevent this, introduce a spinlock in struct hidraw to protect
list from concurrent access.
Commit-id of upstream change:
277fe44dd862412ee034470ad1c13a79d24e533b
Bug
200216971
Change-Id: Ib144abe4851e2cae12e7533bee763e8d9a97d5d4
Signed-off-by: Yonghua Zheng <younghua.zheng@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-on: http://git-master/r/
1198707
Reviewed-by: Raymond Poudrier <rapoudrier@nvidia.com>
Reviewed-by: David Dastous St Hilaire <ddastoussthi@nvidia.com>