Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8aeca8fe authored by Florian Zumbiehl's avatar Florian Zumbiehl Committed by David S. Miller
Browse files

[PPPoE]: move lock_sock() in pppoe_sendmsg() to the right location



and the last one for now: Acquire the sock lock in pppoe_sendmsg()
before accessing the sock - and in particular avoid releasing the lock
even though it hasn't been acquired.

Signed-off-by: default avatarFlorian Zumbiehl <florz@florz.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 86c1dcfc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -774,6 +774,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
	struct net_device *dev;
	char *start;

	lock_sock(sk);
	if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) {
		error = -ENOTCONN;
		goto end;
@@ -784,8 +785,6 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
	hdr.code = 0;
	hdr.sid = po->num;

	lock_sock(sk);

	dev = po->pppoe_dev;

	error = -EMSGSIZE;