patch-2.1.30 linux/net/rose/af_rose.c

Next file: linux/net/rose/rose_dev.c
Previous file: linux/net/netsyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/net/rose/af_rose.c linux/net/rose/af_rose.c
@@ -469,13 +469,13 @@
 	if (level != SOL_ROSE)
 		return -ENOPROTOOPT;
 
-	if(optlen<sizeof(int))
+	if (optlen < sizeof(int))
 		return -EINVAL;
-	if(get_user(opt, (int *)optval))
+
+	if (get_user(opt, (int *)optval))
 		return -EFAULT;
 
-	switch (optname) 
-	{
+	switch (optname) {
 		case ROSE_T1:
 			if (opt < 1)
 				return -EINVAL;
@@ -525,7 +525,7 @@
 	if (level != SOL_ROSE)
 		return -ENOPROTOOPT;
 		
-	if(get_user(len,optlen))
+	if (get_user(len, optlen))
 		return -EFAULT;
 	
 	switch (optname) {
@@ -557,11 +557,14 @@
 			return -ENOPROTOOPT;
 	}
 
-	len=min(len,sizeof(int));
-	if(put_user(len,optlen))
+	len = min(len, sizeof(int));
+
+	if (put_user(len, optlen))
 		return -EFAULT;
-	if(copy_to_user(optval,&val,len))
+
+	if (copy_to_user(optval, &val, len))
 		return -EFAULT;
+
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov