aboutsummaryrefslogtreecommitdiff
path: root/net/x25/af_x25.c
diff options
context:
space:
mode:
authorandrew hendry <andrew.hendry@gmail.com>2010-11-18 13:21:28 +0000
committerDavid S. Miller <davem@davemloft.net>2010-11-19 12:40:01 -0800
commit54aafbd4989a684ca876e49bf3e6eb931654dc02 (patch)
tree5443ecbdbc31bed1973595f56f8ee9fc9a64d938 /net/x25/af_x25.c
parent1ecd66bf2ce5e0f2bc72ffdeed814bb0e55a60dc (diff)
X25: remove bkl in inq and outq ioctls
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r--net/x25/af_x25.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 22597838cc7..2f235a6cb3b 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1361,12 +1361,10 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case TIOCOUTQ: {
int amount;
- lock_kernel();
amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
if (amount < 0)
amount = 0;
rc = put_user(amount, (unsigned int __user *)argp);
- unlock_kernel();
break;
}
@@ -1377,11 +1375,11 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
* These two are safe on a single CPU system as
* only user tasks fiddle here
*/
- lock_kernel();
+ lock_sock(sk);
if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
amount = skb->len;
+ release_sock(sk);
rc = put_user(amount, (unsigned int __user *)argp);
- unlock_kernel();
break;
}