Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224448
b: refs/heads/master
c: 54aafbd
h: refs/heads/master
v: v3
  • Loading branch information
andrew hendry authored and David S. Miller committed Nov 19, 2010
1 parent b026b34 commit 12cf9fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ecd66bf2ce5e0f2bc72ffdeed814bb0e55a60dc
refs/heads/master: 54aafbd4989a684ca876e49bf3e6eb931654dc02
6 changes: 2 additions & 4 deletions trunk/net/x25/af_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 12cf9fb

Please sign in to comment.