]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (max1111) Fix race condition causing NULL pointer exception
authorPavel Herrmann <morpheus.ibis@gmail.com>
Sun, 17 Jul 2011 16:39:19 +0000 (18:39 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 17 May 2012 15:21:11 +0000 (11:21 -0400)
commitfd4eb5ed110c04d95e6f57dee0f6ebabfd4e20b0
tree00985136d3e0402a76a1cb1b652855fa55460a69
parent2d89eba9cc7be4dfabe523067bff245632181536
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: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/hwmon/max1111.c