Skip to contentSkip to conversation

X25: remove bkl in inq and outq ioctls

PATCH Applied Andrew Hendry 2 participants 2 messages Nov 18, 2010 – Nov 19, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/4 X25: remove bkl in inq and outq ioctls

---
 net/x25/af_x25.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
net/x25/af_x25.c +2 -4
index 2259783..2f235a6 100644
@@ -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;
 		}
 
Signature · 1 line
1.7.1