Skip to content
Commit 277fe44d authored by Yonghua Zheng's avatar Yonghua Zheng Committed by Jiri Kosina
Browse files

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.

Signed-off-by: default avatarYonghua Zheng <younghua.zheng@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 06bb5219
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment