diff options
author | andrew hendry <andrew.hendry@gmail.com> | 2010-11-18 08:21:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-19 15:40:01 -0500 |
commit | 54aafbd4989a684ca876e49bf3e6eb931654dc02 (patch) | |
tree | 5443ecbdbc31bed1973595f56f8ee9fc9a64d938 /net/x25 | |
parent | 1ecd66bf2ce5e0f2bc72ffdeed814bb0e55a60dc (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')
-rw-r--r-- | net/x25/af_x25.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 22597838cc76..2f235a6cb3b1 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) | |||
1361 | case TIOCOUTQ: { | 1361 | case TIOCOUTQ: { |
1362 | int amount; | 1362 | int amount; |
1363 | 1363 | ||
1364 | lock_kernel(); | ||
1365 | amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); | 1364 | amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk); |
1366 | if (amount < 0) | 1365 | if (amount < 0) |
1367 | amount = 0; | 1366 | amount = 0; |
1368 | rc = put_user(amount, (unsigned int __user *)argp); | 1367 | rc = put_user(amount, (unsigned int __user *)argp); |
1369 | unlock_kernel(); | ||
1370 | break; | 1368 | break; |
1371 | } | 1369 | } |
1372 | 1370 | ||
@@ -1377,11 +1375,11 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
1377 | * These two are safe on a single CPU system as | 1375 | * These two are safe on a single CPU system as |
1378 | * only user tasks fiddle here | 1376 | * only user tasks fiddle here |
1379 | */ | 1377 | */ |
1380 | lock_kernel(); | 1378 | lock_sock(sk); |
1381 | if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) | 1379 | if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) |
1382 | amount = skb->len; | 1380 | amount = skb->len; |
1381 | release_sock(sk); | ||
1383 | rc = put_user(amount, (unsigned int __user *)argp); | 1382 | rc = put_user(amount, (unsigned int __user *)argp); |
1384 | unlock_kernel(); | ||
1385 | break; | 1383 | break; |
1386 | } | 1384 | } |
1387 | 1385 | ||