Commit 3aecfbb1 authored by David S. Miller's avatar David S. Miller

Merge branch 'l2tp-sockopt-errors'

Guillaume Nault says:

====================
l2tp: fix error handling of PPPoL2TP socket options

Fix pppol2tp_[gs]etsockopt() so that they don't ignore errors returned
by their helper functions.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents cc663f4d 321a52a3
......@@ -1383,8 +1383,6 @@ static int pppol2tp_setsockopt(struct socket *sock, int level, int optname,
} else
err = pppol2tp_session_setsockopt(sk, session, optname, val);
err = 0;
end_put_sess:
sock_put(sk);
end:
......@@ -1507,8 +1505,13 @@ static int pppol2tp_getsockopt(struct socket *sock, int level, int optname,
err = pppol2tp_tunnel_getsockopt(sk, tunnel, optname, &val);
sock_put(ps->tunnel_sock);
} else
if (err)
goto end_put_sess;
} else {
err = pppol2tp_session_getsockopt(sk, session, optname, &val);
if (err)
goto end_put_sess;
}
err = -EFAULT;
if (put_user(len, optlen))
......
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