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

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