]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/arm64/mm/fault.c
arch: mm: do not invoke OOM killer on kernel fault OOM
[karo-tx-linux.git] / arch / arm64 / mm / fault.c
index 6c8ba25bf6bb39eed908ea23edb05c9bb605fed2..0bb7db41f4fe1a85f7059411b51d1ff24e015414 100644 (file)
@@ -288,6 +288,13 @@ retry:
                              VM_FAULT_BADACCESS))))
                return 0;
 
+       /*
+        * If we are in kernel mode at this point, we have no context to
+        * handle this fault with.
+        */
+       if (!user_mode(regs))
+               goto no_context;
+
        if (fault & VM_FAULT_OOM) {
                /*
                 * We ran out of memory, call the OOM killer, and return to
@@ -298,13 +305,6 @@ retry:
                return 0;
        }
 
-       /*
-        * If we are in kernel mode at this point, we have no context to
-        * handle this fault with.
-        */
-       if (!user_mode(regs))
-               goto no_context;
-
        if (fault & VM_FAULT_SIGBUS) {
                /*
                 * We had some memory, but were unable to successfully fix up