提交 8aeca8fe 编写于 作者: F Florian Zumbiehl 提交者: David S. Miller

[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: NFlorian Zumbiehl <florz@florz.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 86c1dcfc
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册