From: Mike Kravetz Date: Fri, 26 Aug 2022 05:03:28 +0000 (-0700) Subject: hugetlb: fix/remove uninitialized variable in remove_inode_hugepages X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fb67e9944b112eae0ff53b746c3745c799e809d0;p=users%2Fjedix%2Flinux-maple.git hugetlb: fix/remove uninitialized variable in remove_inode_hugepages Code introduced for the routine remove_inode_hugepages by patch "hugetlb: handle truncate racing with page faults", incorrectly uses a variable m_index. This is a remnant from a previous version of the code when under development. Use the correct variable 'index' and remove 'm_index' from the routine. Link: https://lkml.kernel.org/r/Ywepr7C2X20ZvLdn@monkey Signed-off-by: Mike Kravetz Cc: Naresh Kamboju Cc: Nathan Chancellor Signed-off-by: Andrew Morton --- diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index e83fd31671b3..5d85b12b35a8 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -537,7 +537,7 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart, const pgoff_t start = lstart >> huge_page_shift(h); const pgoff_t end = lend >> huge_page_shift(h); pgoff_t m_end = lm_end >> huge_page_shift(h); - pgoff_t m_start, m_index; + pgoff_t m_start; struct folio_batch fbatch; struct folio *folio; pgoff_t next, index; @@ -559,7 +559,7 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart, * due to a race with fault code. */ freed += fault_lock_inode_indicies(h, inode, mapping, - m_start, m_index, truncate_op); + m_start, index, truncate_op); /* * Remove folio that was part of folio_batch.