mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
hugetlb: fix an error code in hugetlb_reserve_pages()
Preserve the error code from region_add() instead of returning success.
Link: https://lkml.kernel.org/r/X9NGZWnZl5/Mt99R@mwanda
Fixes: 0db9d74ed8
("hugetlb: disable region_add file_region coalescing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
39a0feaef1
commit
7fc2513aa2
@ -5113,6 +5113,7 @@ int hugetlb_reserve_pages(struct inode *inode,
|
||||
|
||||
if (unlikely(add < 0)) {
|
||||
hugetlb_acct_memory(h, -gbl_reserve);
|
||||
ret = add;
|
||||
goto out_put_pages;
|
||||
} else if (unlikely(chg > add)) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user