summaryrefslogtreecommitdiff
path: root/net/x25
diff options
context:
space:
mode:
authorAndrew Hendry <andrew.hendry@gmail.com>2010-09-14 20:38:54 -0700
committerDavid S. Miller <davem@davemloft.net>2010-09-14 20:38:54 -0700
commit141646ce56735cedb2336b3cd21364287f0aa4c7 (patch)
tree204b0396a60a6954df2fe1dd654e47955c2c7533 /net/x25
parent90c27297a9bfb8ea11c0e3f73ad90c4c66e8501e (diff)
X.25 remove bkl in accept
Accept already has socket locking. [ Extend socket locking over TCP_LISTEN state test. -DaveM ] Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25')
-rw-r--r--net/x25/af_x25.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index bd6fce31a73..04321eec65e 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -869,8 +869,7 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags)
struct sk_buff *skb;
int rc = -EINVAL;
- lock_kernel();
- if (!sk || sk->sk_state != TCP_LISTEN)
+ if (!sk)
goto out;
rc = -EOPNOTSUPP;
@@ -878,6 +877,10 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags)
goto out;
lock_sock(sk);
+ rc = -EINVAL;
+ if (sk->sk_state != TCP_LISTEN)
+ goto out2;
+
rc = x25_wait_for_data(sk, sk->sk_rcvtimeo);
if (rc)
goto out2;
@@ -897,7 +900,6 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags)
out2:
release_sock(sk);
out:
- unlock_kernel();
return rc;
}