summaryrefslogtreecommitdiff
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-03-16 23:09:53 +0300
committerDavid S. Miller <davem@davemloft.net>2019-03-16 23:16:37 +0300
commit9180bb4f046064dfa4541488102703b402bb04e1 (patch)
tree8f5cd0f61fe38104ecb70f84ac3a63d6f9f4559b /drivers/net/tun.c
parent0aedadcf6b4863a0d6eaad05a26425cc52944027 (diff)
downloadlinux-9180bb4f046064dfa4541488102703b402bb04e1.tar.xz
tun: add a missing rcu_read_unlock() in error path
In my latest patch I missed one rcu_read_unlock(), in case device is down. Fixes: 4477138fa0ae ("tun: properly test for IFF_UP") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 0d343359f647..e9ca1c088d0b 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1960,6 +1960,7 @@ drop:
rcu_read_lock();
if (unlikely(!(tun->dev->flags & IFF_UP))) {
err = -EIO;
+ rcu_read_unlock();
goto drop;
}