]> Pileus Git - ~andy/linux/blobdiff - security/seclvl.c
kconfig: fix time ordering of writes to .kconfig.d and include/linux/autoconf.h
[~andy/linux] / security / seclvl.c
index 241093d6f0b89fc0daecde1b7c29e062cc382989..8529ea6f7aa83437174727478988702d4e9db89b 100644 (file)
@@ -252,7 +252,7 @@ passwd_write_file(struct file * file, const char __user * buf,
        }
 
        if (count < 0 || count >= PAGE_SIZE)
-               return -ENOMEM;
+               return -EINVAL;
        if (*ppos != 0)
                return -EINVAL;
        page = (char *)get_zeroed_page(GFP_KERNEL);
@@ -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)) {