diff options
author | Fabian Frederick <fabf@skynet.be> | 2015-02-20 13:12:57 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-06 21:08:42 -0500 |
commit | 97f9f707d26dfe34368a5b88f1996f2eaf973b42 (patch) | |
tree | 366b6e1778ad0489755a74289e1622f6145f9dff | |
parent | 5dcb34bbc3f3274b37a71a71f1b60ac96782a5ed (diff) |
serial: core: replace current->state by __set_current_state()
Use helper functions to access current->state.
Direct assignments are prone to races and therefore buggy.
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/serial_core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 6a1055ae3437..63d29473c703 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -1118,8 +1118,7 @@ uart_wait_modem_status(struct uart_state *state, unsigned long arg) | |||
1118 | 1118 | ||
1119 | cprev = cnow; | 1119 | cprev = cnow; |
1120 | } | 1120 | } |
1121 | 1121 | __set_current_state(TASK_RUNNING); | |
1122 | current->state = TASK_RUNNING; | ||
1123 | remove_wait_queue(&port->delta_msr_wait, &wait); | 1122 | remove_wait_queue(&port->delta_msr_wait, &wait); |
1124 | 1123 | ||
1125 | return ret; | 1124 | return ret; |