Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

andrew hendry and committed by
David S. Miller
54aafbd4 1ecd66bf

+2 -4
+2 -4
net/x25/af_x25.c
··· 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 ··· 1375 1377 * These two are safe on a single CPU system as 1376 1378 * only user tasks fiddle here 1377 1379 */ 1378 - lock_kernel(); 1380 + lock_sock(sk); 1379 1381 if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) 1380 1382 amount = skb->len; 1383 + release_sock(sk); 1381 1384 rc = put_user(amount, (unsigned int __user *)argp); 1382 - unlock_kernel(); 1383 1385 break; 1384 1386 } 1385 1387