patch-2.1.11 linux/kernel/info.c
Next file: linux/kernel/itimer.c
Previous file: linux/include/net/udp.h
Back to the patch index
Back to the overall index
- Lines: 22
- Date:
Mon Nov 18 12:14:26 1996
- Orig file:
v2.1.10/linux/kernel/info.c
- Orig date:
Tue Oct 29 19:58:48 1996
diff -u --recursive --new-file v2.1.10/linux/kernel/info.c linux/kernel/info.c
@@ -17,12 +17,8 @@
asmlinkage int sys_sysinfo(struct sysinfo *info)
{
- int error;
struct sysinfo val;
- error = verify_area(VERIFY_WRITE, info, sizeof(struct sysinfo));
- if (error)
- return error;
memset((char *)&val, 0, sizeof(struct sysinfo));
val.uptime = jiffies / HZ;
@@ -36,6 +32,7 @@
si_meminfo(&val);
si_swapinfo(&val);
- copy_to_user(info, &val, sizeof(struct sysinfo));
+ if (copy_to_user(info, &val, sizeof(struct sysinfo)))
+ return -EFAULT;
return 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov