summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgnc/dgnc_driver.c
diff options
context:
space:
mode:
authorSalah Triki <salah.triki@acm.org>2015-10-04 02:49:48 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 09:30:14 +0100
commit51abf45c23872df0a43dbe849eb4439ebda6145f (patch)
treeb89016372e4bbc02e242fbe238181702fc29a2ca /drivers/staging/dgnc/dgnc_driver.c
parent6d99d6a3cffdcbf1705ebd41b528fc31feaa7966 (diff)
downloadop-kernel-dev-51abf45c23872df0a43dbe849eb4439ebda6145f.zip
op-kernel-dev-51abf45c23872df0a43dbe849eb4439ebda6145f.tar.gz
staging: dgnc: take a lock when storing value in dgnc_poll_tick
Reads of dgnc_poll_tick are protected by dgnc_poll_lock spinlock, but the write to dgnc_poll_tick is not. It could theoretically race. Signed-off-by: Salah Triki <salah.triki@acm.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgnc/dgnc_driver.c')
-rw-r--r--drivers/staging/dgnc/dgnc_driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index ae81a8b..ce2d1c7 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -63,6 +63,7 @@ static const struct file_operations dgnc_BoardFops = {
uint dgnc_NumBoards;
struct dgnc_board *dgnc_Board[MAXBOARDS];
DEFINE_SPINLOCK(dgnc_global_lock);
+DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
uint dgnc_Major;
int dgnc_poll_tick = 20; /* Poll interval - 20 ms */
@@ -74,7 +75,6 @@ static struct class *dgnc_class;
/*
* Poller stuff
*/
-static DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
static ulong dgnc_poll_time; /* Time of next poll */
static uint dgnc_poll_stop; /* Used to tell poller to stop */
static struct timer_list dgnc_poll_timer;
OpenPOWER on IntegriCloud