[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190718155238.3066-1-mbalant3@gmail.com>
Date: Thu, 18 Jul 2019 08:52:38 -0700
From: Mark Balantzyan <mbalant3@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: mbalant3@...il.com, wim@...ux-watchdog.org,
linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org,
Pavel Andrianov <andrianov@...ras.ru>,
Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH] watchdog:alim1535_wdt: Fix data race in ali_settimer() concerning ali_timeout_bits variable. variable.
---
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@...il.com>
Cc: Pavel Andrianov <andrianov@...ras.ru>
Cc:Wim Van Sebroeck <wim@...ux-watchdog.org> (maintainer:WATCHDOG DEVICE DRIVERS)
Cc: Guenter Roeck <linux@...ck-us.net> (maintainer:WATCHDOG DEVICE DRIVERS)
Cc:linux-watchdog@...r.kernel.org (open list:WATCHDOG DEVICE DRIVERS)
Cc:linux-kernel@...r.kernel.org (open list)
Powered by blists - more mailing lists