summaryrefslogtreecommitdiff
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-03-16 23:09:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-03 07:26:19 +0300
commite044d21c2999d35c26cc15011e6478e2a9eaee63 (patch)
treed12c044bd83dcf976f0b8c1e80ae66d7bfff9253 /drivers/net/tun.c
parent6bdb5fdc4787fb621676c5d7380b9351b79cd9f8 (diff)
downloadlinux-e044d21c2999d35c26cc15011e6478e2a9eaee63.tar.xz
tun: add a missing rcu_read_unlock() in error path
commit 9180bb4f046064dfa4541488102703b402bb04e1 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 76dd8580e287..044d5c3a4d04 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1915,6 +1915,7 @@ drop:
rcu_read_lock();
if (unlikely(!(tun->dev->flags & IFF_UP))) {
err = -EIO;
+ rcu_read_unlock();
goto drop;
}