aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFlorian Zumbiehl <florz@florz.de>2007-07-30 20:49:13 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-31 05:28:23 -0400
commit8aeca8fea5f2de2563e097829d62af30ca2de650 (patch)
treed7fe27b3cef67e8f44836082ea21c42e88ab5d58 /drivers
parent86c1dcfc96a778433ebc6e9b1d3e80a126cb80f2 (diff)
[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: Florian Zumbiehl <florz@florz.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/pppoe.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index f75aeaaf861f..35a7385ccb2a 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -774,6 +774,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
774 struct net_device *dev; 774 struct net_device *dev;
775 char *start; 775 char *start;
776 776
777 lock_sock(sk);
777 if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) { 778 if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) {
778 error = -ENOTCONN; 779 error = -ENOTCONN;
779 goto end; 780 goto end;
@@ -784,8 +785,6 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
784 hdr.code = 0; 785 hdr.code = 0;
785 hdr.sid = po->num; 786 hdr.sid = po->num;
786 787
787 lock_sock(sk);
788
789 dev = po->pppoe_dev; 788 dev = po->pppoe_dev;
790 789
791 error = -EMSGSIZE; 790 error = -EMSGSIZE;