Message ID | 1424455977-21903-5-git-send-email-fabf@skynet.be |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Fabian Frederick <fabf@skynet.be> Date: Fri, 20 Feb 2015 19:12:55 +0100 > 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> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 9cdfb3f..778e915 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -1594,7 +1594,7 @@ hso_wait_modem_status(struct hso_serial *serial, unsigned long arg) } cprev = cnow; } - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); remove_wait_queue(&tiocmget->waitq, &wait); return ret;
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> --- drivers/net/usb/hso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)