tun: fix blocking read
authorTimur Celik <mail@timurcelik.de>
Sat, 23 Feb 2019 11:53:13 +0000 (12:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Mar 2019 06:17:18 +0000 (07:17 +0100)
commit488b940719b708c9fae904bac95d4db832bf05f0
treec40a09b80ffd051d6bc00bc1c8894dd5de3abb2b
parentab04570d82b164daca4917c459c152dfb3839448
tun: fix blocking read

[ Upstream commit 71828b2240692cec0e68b8d867bc00e1745e7fae ]

This patch moves setting of the current state into the loop. Otherwise
the task may end up in a busy wait loop if none of the break conditions
are met.

Signed-off-by: Timur Celik <mail@timurcelik.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/tun.c