hwmon: (max1111) Fix race condition causing NULL pointer exception
commitf3224411a780b5849a7983e5415c7521866af384
authorPavel Herrmann <morpheus.ibis@gmail.com>
Sun, 17 Jul 2011 16:39:19 +0000 (17 18:39 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 3 Aug 2011 19:42:41 +0000 (3 12:42 -0700)
tree7ec6e7391aa42fcdc344b8298aac8abf2172c628
parent9c48d9aa90d28159c7dd7a23d48eaca1ac4bf201
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