]> git.baikalelectronics.ru Git - kernel.git/commit
hid: thingm: reorder calls in thingm_probe
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 10 Mar 2016 19:52:21 +0000 (20:52 +0100)
committerJiri Kosina <jkosina@suse.cz>
Tue, 15 Mar 2016 14:28:55 +0000 (15:28 +0100)
commitd23ff933eff58f04a1b70222295f649e3f534aa0
tree57e8a59d8488e81b230222c474fd337572c353c2
parent91f43f09a1a1e2f9cb35273106ead79017509f82
hid: thingm: reorder calls in thingm_probe

When reviewing another thingm patch Benjamin Tissoires pointed out
the following: "The problem here is that hid_hw_start() is called
before thingm_version() which allows user space to briefly introduce
races between thingm_version() and any hidraw requests.
The mutex will not help here as it is initialized after hid_hw_start()
and only used for protecting the concurrent access of the rgb."

Avoid this possible issue by calling hid_hw_start() later in the
probe function.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-thingm.c