diff mbox

[net-next,5/5] X25 remove bkl in call user data length ioctl

Message ID 1290687525.5053.43.camel@jaunty
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

andrew hendry Nov. 25, 2010, 12:18 p.m. UTC
Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>

---
 net/x25/af_x25.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

Comments

David Miller Nov. 28, 2010, 7:13 p.m. UTC | #1
From: Andrew Hendry <andrew.hendry@gmail.com>
Date: Thu, 25 Nov 2010 23:18:45 +1100

> 
> Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 8cfc419..ad96ee9 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;
 		}