diff mbox

[net-next,3/5] X25 remove bkl from calluserdata ioctls

Message ID 1290687520.5053.41.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 |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 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:40 +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 2518efa..e2eea0a 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1512,11 +1512,11 @@  out_dtefac_release:
 		}
 
 		case SIOCX25GCALLUSERDATA: {
-			struct x25_calluserdata cud = x25->calluserdata;
-			lock_kernel();
-			rc = copy_to_user(argp, &cud,
-					  sizeof(cud)) ? -EFAULT : 0;
-			unlock_kernel();
+			lock_sock(sk);
+			rc = copy_to_user(argp, &x25->calluserdata,
+					sizeof(x25->calluserdata))
+					? -EFAULT : 0;
+			release_sock(sk);
 			break;
 		}
 
@@ -1524,15 +1524,15 @@  out_dtefac_release:
 			struct x25_calluserdata calluserdata;
 
 			rc = -EFAULT;
-			lock_kernel();
 			if (copy_from_user(&calluserdata, argp,
 					   sizeof(calluserdata)))
 				break;
 			rc = -EINVAL;
 			if (calluserdata.cudlength > X25_MAX_CUD_LEN)
 				break;
+			lock_sock(sk);
 			x25->calluserdata = calluserdata;
-			unlock_kernel();
+			release_sock(sk);
 			rc = 0;
 			break;
 		}