[PATCH 1/1 net-next] net/atm/signaling.c: replace current->state by __set_current_state()

From: Fabian Frederick
Date: Mon Feb 23 2015 - 12:31:21 EST

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@xxxxxxxxxxxxx>
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
net/atm/signaling.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index 523bce7..0140832 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -40,7 +40,7 @@ static void sigd_put_skb(struct sk_buff *skb)
pr_debug("atmsvc: waiting for signaling daemon...\n");
- current->state = TASK_RUNNING;
+ __set_current_state(TASK_RUNNING);
remove_wait_queue(&sigd_sleep, &wait);
if (!sigd) {

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/