diff options
author | Fabian Frederick <fabf@skynet.be> | 2015-02-23 18:38:24 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-23 23:21:11 +0100 |
commit | a948f8ce771a1f07c17ed8bcb51f59f69129a51c (patch) | |
tree | ebb5f5c97f00edc2fec15b4518e6f29ccdcbe3f7 /net/irda | |
parent | net: sched: export tc_connmark.h so it is uapi accessible (diff) | |
download | linux-a948f8ce771a1f07c17ed8bcb51f59f69129a51c.tar.xz linux-a948f8ce771a1f07c17ed8bcb51f59f69129a51c.zip |
irda: replace current->state by set_current_state()
Use helper functions to access current->state.
Direct assignments are prone to races and therefore buggy.
current->state = TASK_RUNNING can be replaced by __set_current_state()
Thanks to Peter Zijlstra for the exact definition of the problem.
Suggested-By: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 2 | ||||
-rw-r--r-- | net/irda/irnet/irnet_ppp.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 40695b9751c1..9940a41efca1 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c @@ -811,7 +811,7 @@ static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout) break; } spin_unlock_irqrestore(&self->spinlock, flags); - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); } /* diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 3c83a1e5ab03..1215693fdd22 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c @@ -305,7 +305,7 @@ irnet_ctrl_read(irnet_socket * ap, /* Put ourselves on the wait queue to be woken up */ add_wait_queue(&irnet_events.rwait, &wait); - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); for(;;) { /* If there is unread events */ @@ -321,7 +321,7 @@ irnet_ctrl_read(irnet_socket * ap, /* Yield and wait to be woken up */ schedule(); } - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); remove_wait_queue(&irnet_events.rwait, &wait); /* Did we got it ? */ |