On 11.12.20 11:13, Dan Carpenter wrote: > Preserve the error code from region_add() instead of returning success. > > Fixes: 0db9d74ed884 ("hugetlb: disable region_add file_region coalescing") > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > --- > From static analysis. Untested. > > mm/hugetlb.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 1f3bf1710b66..ac2e48b9f1d7 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -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)) { > /* > Was wioing if something like return ret ? ret : add; would be cleaner, but then I spotted "chg" ... Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> -- Thanks, David / dhildenb