linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog:alim1535_wdt: Fix data race in ali_settimer() concerning ali_timeout_bits variable.  variable.
@ 2019-07-18 15:52 Mark Balantzyan
  2019-07-18 16:34 ` Guenter Roeck
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Balantzyan @ 2019-07-18 15:52 UTC (permalink / raw)
  Cc: mbalant3, wim, linux-watchdog, linux-kernel, Pavel Andrianov,
	Guenter Roeck

---
 drivers/watchdog/alim1535_wdt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c
index 60f0c2eb..4ba2b860 100644
--- a/drivers/watchdog/alim1535_wdt.c
+++ b/drivers/watchdog/alim1535_wdt.c
@@ -107,6 +107,7 @@ static void ali_keepalive(void)
 
 static int ali_settimer(int t)
 {
+    spin_lock(&ali_lock);
     if (t < 0)
         return -EINVAL;
     else if (t < 60)
@@ -117,7 +118,7 @@ static int ali_settimer(int t)
         ali_timeout_bits = (t / 300)|(1 << 6)|(1 << 7);
     else
         return -EINVAL;
-
+    spin_unlock(&ali_lock);
     timeout = t;
     return 0;
 }
-- 
2.17.1
Signed-off-by: Mark Balantzyan <mbalant3@gmail.com>
Cc: Pavel Andrianov <andrianov@ispras.ru>
Cc:Wim Van Sebroeck <wim@linux-watchdog.org> (maintainer:WATCHDOG DEVICE DRIVERS)
Cc: Guenter Roeck <linux@roeck-us.net> (maintainer:WATCHDOG DEVICE DRIVERS)
Cc:linux-watchdog@vger.kernel.org (open list:WATCHDOG DEVICE DRIVERS)
Cc:linux-kernel@vger.kernel.org (open list)

^ permalink raw reply related	[flat|nested] 9+ messages in thread
[parent not found: <CACV1r+a4bz+5L_AkYJ0NXkhwarx30=W3MQ20ur1A4Z-zEOE=FA@mail.gmail.com>]

end of thread, other threads:[~2019-07-31 23:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18 15:52 [PATCH] watchdog:alim1535_wdt: Fix data race in ali_settimer() concerning ali_timeout_bits variable. variable Mark Balantzyan
2019-07-18 16:34 ` Guenter Roeck
2019-07-31 16:17   ` [PATCH] watchdog:alim1535_wdt: Fix data race in ali_settimer() concerning ali_timeout_bits variable Mark Balantzyan
2019-07-31 16:43     ` Guenter Roeck
2019-07-31 17:04       ` Mark Balantzyan
2019-07-31 18:23       ` Mark Balantzyan
2019-07-31 19:24         ` Guenter Roeck
2019-07-31 23:37           ` Mark Balantzyan
     [not found] <CACV1r+a4bz+5L_AkYJ0NXkhwarx30=W3MQ20ur1A4Z-zEOE=FA@mail.gmail.com>
2019-07-22 16:38 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).