Commit 141646ce authored by Andrew Hendry's avatar Andrew Hendry Committed by David S. Miller

X.25 remove bkl in accept

Accept already has socket locking.

[ Extend socket locking over TCP_LISTEN state test. -DaveM ]
Signed-off-by: default avatarAndrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 90c27297
...@@ -869,8 +869,7 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -869,8 +869,7 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags)
struct sk_buff *skb; struct sk_buff *skb;
int rc = -EINVAL; int rc = -EINVAL;
lock_kernel(); if (!sk)
if (!sk || sk->sk_state != TCP_LISTEN)
goto out; goto out;
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
...@@ -878,6 +877,10 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -878,6 +877,10 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags)
goto out; goto out;
lock_sock(sk); lock_sock(sk);
rc = -EINVAL;
if (sk->sk_state != TCP_LISTEN)
goto out2;
rc = x25_wait_for_data(sk, sk->sk_rcvtimeo); rc = x25_wait_for_data(sk, sk->sk_rcvtimeo);
if (rc) if (rc)
goto out2; goto out2;
...@@ -897,7 +900,6 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -897,7 +900,6 @@ static int x25_accept(struct socket *sock, struct socket *newsock, int flags)
out2: out2:
release_sock(sk); release_sock(sk);
out: out:
unlock_kernel();
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment