X25 remove bkl in call user data length ioctl
authorandrew hendry <andrew.hendry@gmail.com>
Thu, 25 Nov 2010 02:18:45 +0000 (02:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Nov 2010 19:12:22 +0000 (11:12 -0800)
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/x25/af_x25.c

index 8cfc419cef4b45a6f4f5361a70eac03f5ee374c9..ad96ee90fe2760d324876a7ec582ed82d71b25d2 100644 (file)
@@ -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;
                }