tun: add a missing rcu_read_unlock() in error path
authorEric Dumazet <edumazet@google.com>
Sat, 16 Mar 2019 20:09:53 +0000 (13:09 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Mar 2019 20:16:37 +0000 (13:16 -0700)
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>
drivers/net/tun.c

index 0d343359f647ff58fee35462358827e61857c837..e9ca1c088d0b11611e4d80268ced3806db05cffb 100644 (file)
@@ -1960,6 +1960,7 @@ drop:
        rcu_read_lock();
        if (unlikely(!(tun->dev->flags & IFF_UP))) {
                err = -EIO;
+               rcu_read_unlock();
                goto drop;
        }