Commit 54aafbd4989a684ca876e49bf3e6eb931654dc02

Authored by andrew hendry
Committed by David S. Miller
1 parent 1ecd66bf2c

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>

Showing 1 changed file with 2 additions and 4 deletions Side-by-side Diff

... ... @@ -1361,12 +1361,10 @@
1361 1361 case TIOCOUTQ: {
1362 1362 int amount;
1363 1363  
1364   - lock_kernel();
1365 1364 amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
1366 1365 if (amount < 0)
1367 1366 amount = 0;
1368 1367 rc = put_user(amount, (unsigned int __user *)argp);
1369   - unlock_kernel();
1370 1368 break;
1371 1369 }
1372 1370  
1373 1371  
1374 1372  
... ... @@ -1377,11 +1375,11 @@
1377 1375 * These two are safe on a single CPU system as
1378 1376 * only user tasks fiddle here
1379 1377 */
1380   - lock_kernel();
  1378 + lock_sock(sk);
1381 1379 if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL)
1382 1380 amount = skb->len;
  1381 + release_sock(sk);
1383 1382 rc = put_user(amount, (unsigned int __user *)argp);
1384   - unlock_kernel();
1385 1383 break;
1386 1384 }
1387 1385