From: Wei Yang Date: Tue, 13 Oct 2020 23:56:23 +0000 (-0700) Subject: mm/hugetlb: remove VM_BUG_ON(!nrg) in get_file_region_entry_from_cache() X-Git-Tag: io_uring-5.10-2020-10-20~81^2~36 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a1ddc2e8250eb550733a3f257ea299a84492d8a7;p=linux-2.6-block.git mm/hugetlb: remove VM_BUG_ON(!nrg) in get_file_region_entry_from_cache() We are sure to get a valid file_region, otherwise the VM_BUG_ON(resv->region_cache_count <= 0) at the very beginning would be triggered. Let's remove the redundant one. Signed-off-by: Wei Yang Signed-off-by: Andrew Morton Reviewed-by: Mike Kravetz Cc: Baoquan He Cc: Vlastimil Babka Link: https://lkml.kernel.org/r/20200831022351.20916-3-richard.weiyang@linux.alibaba.com Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index dc2977750e85..39f86bbcb07e 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -240,7 +240,6 @@ get_file_region_entry_from_cache(struct resv_map *resv, long from, long to) resv->region_cache_count--; nrg = list_first_entry(&resv->region_cache, struct file_region, link); - VM_BUG_ON(!nrg); list_del(&nrg->link); nrg->from = from;