]> git.karo-electronics.de Git - karo-tx-linux.git/commit
platform/x86: dell-laptop: Protect kbd_state against races
authorHans de Goede <hdegoede@redhat.com>
Thu, 16 Mar 2017 10:55:34 +0000 (11:55 +0100)
committerDarren Hart (VMware) <dvhart@infradead.org>
Thu, 13 Apr 2017 17:12:44 +0000 (10:12 -0700)
commite5bf5df7858e2339d277427129139995628c49a7
treee75d7650eca495e3c2811b1ba3f1ef06bf4fd0f2
parent1c7e28246e986a789a55f52ff681bf8d5d1dcada
platform/x86: dell-laptop: Protect kbd_state against races

The kbd led code has multiple entry points each of which modifies the
kbd_state by reading it, modifying a copy, writing the copy and on
error setting the modified copy writing back the original state.

This is racy, so add a mutex protection the read-modify-write cycle
on each of the entry points.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/dell-laptop.c