diff options
Diffstat (limited to 'net/x25/af_x25.c')
-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 | ||