diff mbox

[5/7,linux-next] hso: replace current->state by __set_current_state()

Message ID 1424455977-21903-5-git-send-email-fabf@skynet.be
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Fabian Frederick Feb. 20, 2015, 6:12 p.m. UTC
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(-)

Comments

David Miller Feb. 22, 2015, 8:25 p.m. UTC | #1
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 mbox

Patch

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;