diff options
-rw-r--r-- | kernel/time.c | 2 | ||||
-rw-r--r-- | security/seclvl.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/kernel/time.c b/kernel/time.c index 7477b1d2079e..1f23e683d6aa 100644 --- a/kernel/time.c +++ b/kernel/time.c @@ -155,7 +155,7 @@ int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) static int firsttime = 1; int error = 0; - if (!timespec_valid(tv)) + if (tv && !timespec_valid(tv)) return -EINVAL; error = security_settime(tv, tz); diff --git a/security/seclvl.c b/security/seclvl.c index 1caac0164643..8529ea6f7aa8 100644 --- a/security/seclvl.c +++ b/security/seclvl.c @@ -368,8 +368,8 @@ static int seclvl_capable(struct task_struct *tsk, int cap) */ static int seclvl_settime(struct timespec *tv, struct timezone *tz) { - struct timespec now; - if (seclvl > 1) { + if (tv && seclvl > 1) { + struct timespec now; now = current_kernel_time(); if (tv->tv_sec < now.tv_sec || (tv->tv_sec == now.tv_sec && tv->tv_nsec < now.tv_nsec)) { |