* [PATCH 3/4] X25: remove bkl in inq and outq ioctls
@ 2010-11-18 23:21 Andrew Hendry
2010-11-19 20:41 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Hendry @ 2010-11-18 23:21 UTC (permalink / raw)
To: netdev
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
---
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 2259783..2f235a6 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)
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;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/4] X25: remove bkl in inq and outq ioctls
2010-11-18 23:21 [PATCH 3/4] X25: remove bkl in inq and outq ioctls Andrew Hendry
@ 2010-11-19 20:41 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-11-19 20:41 UTC (permalink / raw)
To: andrew.hendry; +Cc: netdev
From: Andrew Hendry <andrew.hendry@gmail.com>
Date: Fri, 19 Nov 2010 10:21:28 +1100
>
> Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-19 20:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 23:21 [PATCH 3/4] X25: remove bkl in inq and outq ioctls Andrew Hendry
2010-11-19 20:41 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).