From: Fabian Frederick Date: Fri, 20 Feb 2015 18:12:57 +0000 (+0100) Subject: serial: core: replace current->state by __set_current_state() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=97f9f707d26dfe34368a5b88f1996f2eaf973b42;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Fabian Frederick Signed-off-by: Greg Kroah-Hartman --- 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) cprev = cnow; } - - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); remove_wait_queue(&port->delta_msr_wait, &wait); return ret;