hwmon: (amc6821) Fix possible race condition bug
authorAxel Lin <axel.lin@ingics.com>
Thu, 31 Jul 2014 01:43:19 +0000 (09:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Sep 2014 23:34:14 +0000 (16:34 -0700)
commitb0f4549190f3d46acfb0d192802aa1d21410d012
tree1f6258c3503f6b66292c355b3eb41bb1dfa376a4
parent728d3c854de8f28464e7a3127e21abde735eb796
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/amc6821.c