fs: buffer: move allocation failure loop into the allocator
[platform/adaptation/renesas_rcar/renesas_kernel.git] / mm / memcontrol.c
index 65fc6a4..34d3ca9 100644 (file)
@@ -2766,6 +2766,8 @@ done:
        return 0;
 nomem:
        *ptr = NULL;
+       if (gfp_mask & __GFP_NOFAIL)
+               return 0;
        return -ENOMEM;
 bypass:
        *ptr = root_mem_cgroup;