diff --git a/drivers/net/tun.c b/drivers/net/tun.c index d556674ccc8b1f92e2687f8e1aa19dc78ad65740..9133eb470bd4f5ce0d574ee9f480f43733410a79 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2121,9 +2121,9 @@ static void *tun_ring_recv(struct tun_file *tfile, int noblock, int *err) } add_wait_queue(&tfile->wq.wait, &wait); - current->state = TASK_INTERRUPTIBLE; while (1) { + set_current_state(TASK_INTERRUPTIBLE); ptr = ptr_ring_consume(&tfile->tx_ring); if (ptr) break; @@ -2139,7 +2139,7 @@ static void *tun_ring_recv(struct tun_file *tfile, int noblock, int *err) schedule(); } - current->state = TASK_RUNNING; + set_current_state(TASK_RUNNING); remove_wait_queue(&tfile->wq.wait, &wait); out: