summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorandrew hendry <andrew.hendry@gmail.com>2010-11-25 05:18:45 +0300
committerDavid S. Miller <davem@davemloft.net>2010-11-28 22:12:22 +0300
commit3f0a069a1d5c0ccace735e3a62c1bcef53e4c354 (patch)
tree13d1f2bcaf11cb933d35eee19de3d90dc82b5833 /net
parent74a7e440807d34e586e9feb8e14851b5c80fbfe5 (diff)
downloadlinux-3f0a069a1d5c0ccace735e3a62c1bcef53e4c354.tar.xz
X25 remove bkl in call user data length ioctl
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/x25/af_x25.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 8cfc419cef4b..ad96ee90fe27 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1562,19 +1562,20 @@ out_dtefac_release:
case SIOCX25SCUDMATCHLEN: {
struct x25_subaddr sub_addr;
rc = -EINVAL;
- lock_kernel();
+ lock_sock(sk);
if(sk->sk_state != TCP_CLOSE)
- break;
+ goto out_cud_release;
rc = -EFAULT;
if (copy_from_user(&sub_addr, argp,
sizeof(sub_addr)))
- break;
+ goto out_cud_release;
rc = -EINVAL;
if(sub_addr.cudmatchlength > X25_MAX_CUD_LEN)
- break;
+ goto out_cud_release;
x25->cudmatchlength = sub_addr.cudmatchlength;
- unlock_kernel();
rc = 0;
+out_cud_release:
+ release_sock(sk);
break;
}