Browse Source

hso: 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: David S. Miller <davem@davemloft.net>
Fabian Frederick 10 years ago
parent
commit
50462ce005
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/usb/hso.c

+ 1 - 1
drivers/net/usb/hso.c

@@ -1594,7 +1594,7 @@ hso_wait_modem_status(struct hso_serial *serial, unsigned long arg)
 		}
 		}
 		cprev = cnow;
 		cprev = cnow;
 	}
 	}
-	current->state = TASK_RUNNING;
+	__set_current_state(TASK_RUNNING);
 	remove_wait_queue(&tiocmget->waitq, &wait);
 	remove_wait_queue(&tiocmget->waitq, &wait);
 
 
 	return ret;
 	return ret;