summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorYanfei Xu <yanfei.xu@windriver.com>2021-07-14 21:26:49 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-07-15 10:13:49 -0700
commite5c15cea339115edf99dc92282865f173cf84510 (patch)
treea1eae9d24bb14b5e06e7ac0f49a4a9e407563cb0 /mm
parent187ad460b8413e863c951998cb321a117a717868 (diff)
downloadlinux-stable-e5c15cea339115edf99dc92282865f173cf84510.tar.gz
linux-stable-e5c15cea339115edf99dc92282865f173cf84510.tar.bz2
linux-stable-e5c15cea339115edf99dc92282865f173cf84510.zip
mm/page_alloc: correct return value when failing at preparing
If the array passed in is already partially populated, we should return "nr_populated" even failing at preparing arguments stage. Link: https://lkml.kernel.org/r/20210713152100.10381-3-mgorman@techsingularity.net Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com> Signed-off-by: Mel Gorman <mgorman@techsingularity.net> Link: https://lore.kernel.org/r/20210709102855.55058-1-yanfei.xu@windriver.com Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 84609716bab5..4d79e357a4ba 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5255,7 +5255,7 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid,
gfp &= gfp_allowed_mask;
alloc_gfp = gfp;
if (!prepare_alloc_pages(gfp, 0, preferred_nid, nodemask, &ac, &alloc_gfp, &alloc_flags))
- return 0;
+ return nr_populated;
gfp = alloc_gfp;
/* Find an allowed local zone that meets the low watermark. */