summaryrefslogtreecommitdiffstats
path: root/net/x25
diff options
context:
space:
mode:
authorandrew hendry <andrew.hendry@gmail.com>2010-11-25 02:18:43 +0000
committerDavid S. Miller <davem@davemloft.net>2010-11-28 11:12:21 -0800
commit74a7e440807d34e586e9feb8e14851b5c80fbfe5 (patch)
tree97df0c1bd07cbb592e8fa45d2ebee5915f8254d5 /net/x25
parent5b7958dfa5db758e36e92e1790075b470b4947f8 (diff)
X25 remove bkl from causediag ioctls
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25')
-rw-r--r--net/x25/af_x25.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index e2eea0aec46..8cfc419cef4 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1538,23 +1538,22 @@ out_dtefac_release:
}
case SIOCX25GCAUSEDIAG: {
- struct x25_causediag causediag;
- lock_kernel();
- causediag = x25->causediag;
- rc = copy_to_user(argp, &causediag,
- sizeof(causediag)) ? -EFAULT : 0;
- unlock_kernel();
+ lock_sock(sk);
+ rc = copy_to_user(argp, &x25->causediag,
+ sizeof(x25->causediag))
+ ? -EFAULT : 0;
+ release_sock(sk);
break;
}
case SIOCX25SCAUSEDIAG: {
struct x25_causediag causediag;
rc = -EFAULT;
- lock_kernel();
if (copy_from_user(&causediag, argp, sizeof(causediag)))
break;
+ lock_sock(sk);
x25->causediag = causediag;
- unlock_kernel();
+ release_sock(sk);
rc = 0;
break;