[PATCH v4 2/9] mm/huge_memory: fix uninitialized compiler warning
From: Alex Shi
Date: Tue Nov 19 2019 - 07:25:05 EST
../mm/huge_memory.c: In function âsplit_huge_page_to_listâ:
../mm/huge_memory.c:2766:9: warning: âflagsâ may be used uninitialized
in this function [-Wmaybe-uninitialized]
lruvec = lock_page_lruvec_irqsave(head, pgdata, flags);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: linux-mm@xxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
mm/huge_memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 13cc93785006..4cdfdbeb6b2b 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2699,7 +2699,7 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
struct address_space *mapping = NULL;
int count, mapcount, extra_pins, ret;
bool mlocked;
- unsigned long flags;
+ unsigned long flags = 0;
pgoff_t end;
VM_BUG_ON_PAGE(is_huge_zero_page(page), page);
--
1.8.3.1