fork: Using clone_flags for legacy clone check
[linux-2.6-block.git] / kernel / fork.c
index 47ff3b35352e0bb4ec040b77241d9cbdcb986ef2..95647c66309f22cbf099974920529076cc372784 100644 (file)
@@ -2875,8 +2875,8 @@ pid_t kernel_clone(struct kernel_clone_args *args)
         * here has the advantage that we don't need to have a separate helper
         * to check for legacy clone().
         */
-       if ((args->flags & CLONE_PIDFD) &&
-           (args->flags & CLONE_PARENT_SETTID) &&
+       if ((clone_flags & CLONE_PIDFD) &&
+           (clone_flags & CLONE_PARENT_SETTID) &&
            (args->pidfd == args->parent_tid))
                return -EINVAL;