sched/debug: Initialize sd_sysctl_cpus if !CONFIG_CPUMASK_OFFSTACK
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / kernel / user_namespace.c
index c490f1e4313b998a60686b98fbdf6b0167753e11..ed80a88980f0f842c6cd429b4281ce8391f80f9e 100644 (file)
@@ -650,7 +650,16 @@ static ssize_t map_write(struct file *file, const char __user *buf,
        unsigned idx;
        struct uid_gid_extent *extent = NULL;
        char *kbuf = NULL, *pos, *next_line;
-       ssize_t ret = -EINVAL;
+       ssize_t ret;
+
+       /* Only allow < page size writes at the beginning of the file */
+       if ((*ppos != 0) || (count >= PAGE_SIZE))
+               return -EINVAL;
+
+       /* Slurp in the user data */
+       kbuf = memdup_user_nul(buf, count);
+       if (IS_ERR(kbuf))
+               return PTR_ERR(kbuf);
 
        /*
         * The userns_state_mutex serializes all writes to any given map.
@@ -684,19 +693,6 @@ static ssize_t map_write(struct file *file, const char __user *buf,
        if (cap_valid(cap_setid) && !file_ns_capable(file, ns, CAP_SYS_ADMIN))
                goto out;
 
-       /* Only allow < page size writes at the beginning of the file */
-       ret = -EINVAL;
-       if ((*ppos != 0) || (count >= PAGE_SIZE))
-               goto out;
-
-       /* Slurp in the user data */
-       kbuf = memdup_user_nul(buf, count);
-       if (IS_ERR(kbuf)) {
-               ret = PTR_ERR(kbuf);
-               kbuf = NULL;
-               goto out;
-       }
-
        /* Parse the user data */
        ret = -EINVAL;
        pos = kbuf;