diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2002-12-13 00:11:10 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-12-13 00:11:10 -0800 |
| commit | 76ffe688b57868d056d01a96790409b7f1bd8245 (patch) | |
| tree | fa9d42281a947c279d2d1c7d0473581e7de19d9b /kernel | |
| parent | cd25ec04b792efcb2f066039097f69751918ec0b (diff) | |
Fix nanosleep() behaviour with NULL "remaining" argument.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/timer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index efa02b1c512c..318b61d4e46f 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1040,7 +1040,7 @@ static long nanosleep_restart(struct restart_block *restart) jiffies_to_timespec(expire, &t); ret = -ERESTART_RESTARTBLOCK; - if (copy_to_user(rmtp, &t, sizeof(t))) + if (rmtp && copy_to_user(rmtp, &t, sizeof(t))) ret = -EFAULT; /* The 'restart' block is already filled in */ } @@ -1067,7 +1067,7 @@ asmlinkage long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp) if (expire) { struct restart_block *restart; jiffies_to_timespec(expire, &t); - if (copy_to_user(rmtp, &t, sizeof(t))) + if (rmtp && copy_to_user(rmtp, &t, sizeof(t))) return -EFAULT; restart = ¤t_thread_info()->restart_block; |
