/*
  * Determines whether the kernel must panic because of the panic_on_oom sysctl.
  */
-static void check_panic_on_oom(struct oom_control *oc,
-                              enum oom_constraint constraint)
+static void check_panic_on_oom(struct oom_control *oc)
 {
        if (likely(!sysctl_panic_on_oom))
                return;
                 * does not panic for cpuset, mempolicy, or memcg allocation
                 * failures.
                 */
-               if (constraint != CONSTRAINT_NONE)
+               if (oc->constraint != CONSTRAINT_NONE)
                        return;
        }
        /* Do not panic for oom kills triggered by sysrq */
 bool out_of_memory(struct oom_control *oc)
 {
        unsigned long freed = 0;
-       enum oom_constraint constraint = CONSTRAINT_NONE;
 
        if (oom_killer_disabled)
                return false;
         * Check if there were limitations on the allocation (only relevant for
         * NUMA and memcg) that may require different handling.
         */
-       constraint = constrained_alloc(oc);
-       if (constraint != CONSTRAINT_MEMORY_POLICY)
+       oc->constraint = constrained_alloc(oc);
+       if (oc->constraint != CONSTRAINT_MEMORY_POLICY)
                oc->nodemask = NULL;
-       check_panic_on_oom(oc, constraint);
+       check_panic_on_oom(oc);
 
        if (!is_memcg_oom(oc) && sysctl_oom_kill_allocating_task &&
            current->mm && !oom_unkillable_task(current, NULL, oc->nodemask) &&