hwmon: (max1111) Fix race condition causing NULL pointer exception
commit166d832bd02cccddb49a1b07e71dbefc0e3e063f
authorPavel Herrmann <morpheus.ibis@gmail.com>
Sun, 17 Jul 2011 16:39:19 +0000 (17 18:39 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 8 Aug 2011 17:23:07 +0000 (8 10:23 -0700)
treee25d54a0437a5be092af8d80c148a4e77773f61f
parentabcd4aa304268111b33daa61cb4dbe75da41b3aa
hwmon: (max1111) Fix race condition causing NULL pointer exception

commit d3f684f2820a7f42acef68bea6622d9032127fb2 upstream.

spi_sync call uses its spi_message parameter to keep completion information,
using a drvdata structure is not thread-safe. Use a mutex to prevent
multiple access to shared driver data.

Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Cyril Hrubis <metan@ucw.cz>
Tested-by: Stanislav Brabec <utx@penguin.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/max1111.c