]> git.baikalelectronics.ru Git - kernel.git/commit
HID: thingm: improve locking
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 1 Mar 2016 19:49:54 +0000 (20:49 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 2 Mar 2016 09:20:31 +0000 (10:20 +0100)
commit91f43f09a1a1e2f9cb35273106ead79017509f82
tree7bcaa4f2b7774bdfddb465b903c79e9fd05ff83e
parent7da7c7aad0b1ec4c5856c9f5a357eb1a04de35c0
HID: thingm: improve locking

Reading from the device consists of two operations: sending the read
command and the actual read from the device. If the device is accessed
in between we might read wrong data. Therefore protect the full sequence
of both operations with a mutex.
Also change the semantics of thingm_recv to include both operations.

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