patch-2.1.11 linux/kernel/time.c
Next file: linux/mm/swapfile.c
Previous file: linux/kernel/sys.c
Back to the patch index
Back to the overall index
- Lines: 27
- Date:
Sat Nov 16 13:11:18 1996
- Orig file:
v2.1.10/linux/kernel/time.c
- Orig date:
Tue Nov 12 15:56:15 1996
diff -u --recursive --new-file v2.1.10/linux/kernel/time.c linux/kernel/time.c
@@ -202,15 +202,13 @@
/* Local copy of parameter */
struct timex txc;
- error = verify_area(VERIFY_WRITE, txc_p, sizeof(struct timex));
- if (error)
- return error;
-
/* Copy the user data space into the kernel copy
* structure. But bear in mind that the structures
* may change
*/
- copy_from_user(&txc, txc_p, sizeof(struct timex));
+ error = copy_from_user(&txc, txc_p, sizeof(struct timex));
+ if (error)
+ return -EFAULT;
/* In order to modify anything, you gotta be super-user! */
if (txc.modes && !suser())
@@ -345,6 +343,5 @@
sti();
- copy_to_user(txc_p, &txc, sizeof(struct timex));
- return time_state;
+ return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : time_state;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov