tun: fix blocking read
commit32869c80859a6fd11b7751e2dc61a04f6feaee9b
authorTimur Celik <mail@timurcelik.de>
Sat, 23 Feb 2019 11:53:13 +0000 (23 12:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:03:09 +0000 (13 14:03 -0700)
treeecbf9af2d34d666fe5131f7561f27d63f2604f91
parenta9494400f8c1ea8d2e760cec1be44dfe225a607b
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