Skip to content

Commit

Permalink
Merge branch 'l2tp-sockopt-errors'
Browse files Browse the repository at this point in the history
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: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Apr 8, 2017
2 parents cc663f4 + 321a52a commit 3aecfbb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/l2tp/l2tp_ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 3aecfbb

Please sign in to comment.