patch-2.1.30 linux/net/netrom/af_netrom.c
Next file: linux/net/netrom/nr_dev.c
Previous file: linux/net/lapb/lapb_timer.c
Back to the patch index
Back to the overall index
- Lines: 52
- Date:
Thu Mar 20 18:17:15 1997
- Orig file:
v2.1.29/linux/net/netrom/af_netrom.c
- Orig date:
Thu Feb 27 10:57:32 1997
diff -u --recursive --new-file v2.1.29/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
@@ -418,19 +418,18 @@
char *optval, int optlen)
{
struct sock *sk = sock->sk;
- int err, opt;
+ int opt;
if (level != SOL_NETROM)
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 NETROM_T1:
if (opt < 1)
return -EINVAL;
@@ -480,7 +479,7 @@
if (level != SOL_NETROM)
return -ENOPROTOOPT;
- if(get_user(len,optlen))
+ if (get_user(len, optlen))
return -EFAULT;
switch (optname) {
@@ -512,11 +511,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