Commit e044d21c authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman

tun: add a missing rcu_read_unlock() in error path

commit 9180bb4f upstream.

In my latest patch I missed one rcu_read_unlock(), in case
device is down.

Fixes: 4477138f ("tun: properly test for IFF_UP")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6bdb5fdc
...@@ -1915,6 +1915,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, ...@@ -1915,6 +1915,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
rcu_read_lock(); rcu_read_lock();
if (unlikely(!(tun->dev->flags & IFF_UP))) { if (unlikely(!(tun->dev->flags & IFF_UP))) {
err = -EIO; err = -EIO;
rcu_read_unlock();
goto drop; goto drop;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment