hwmon: (amc6821) Fix possible race condition bug
authorAxel Lin <axel.lin@ingics.com>
Thu, 31 Jul 2014 01:43:19 +0000 (09:43 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 13 Sep 2014 22:41:41 +0000 (23:41 +0100)
commit3e6d3af6998364cc2242dbc7a1d3eccd8bd25eba
tree93a26c060fb0327c7bbfa3f00d47aac865164e39
parent0719a7b890bfdeebe8fe2ffd7addb7e20d2ec518
hwmon: (amc6821) Fix possible race condition bug

commit cf44819c98db11163f58f08b822d626c7a8f5188 upstream.

Ensure mutex lock protects the read-modify-write period to prevent possible
race condition bug.
In additional, update data->valid should also be protected by the mutex lock.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/hwmon/amc6821.c