From e7d7db4475a85d9ecd8bf8987112b2f1eb73e7e3 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Wed, 11 Nov 2015 11:33:34 +1100 Subject: [PATCH] khugepaged: avoid usage of uninitialized variable 'isolated' In file included from include/trace/events/huge_memory.h:7:0, from mm/huge_memory.c:62: include/linux/tracepoint.h:141:5: warning: `isolated' may be used uninitialized in this function [-Wmaybe-uninitialized] ((void(*)(proto))(it_func))(args); \ ^ mm/huge_memory.c:2327:6: note: `isolated' was declared here int isolated, result = 0; We make use of isolated in error path before it get initialized. Signed-off-by: Kirill A. Shutemov Cc: Ebru Akagunduz Signed-off-by: Andrew Morton --- 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 18a72c58cbec63..3f5cc2dd08a511 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2594,7 +2594,7 @@ static void collapse_huge_page(struct mm_struct *mm, pgtable_t pgtable; struct page *new_page; spinlock_t *pmd_ptl, *pte_ptl; - int isolated, result = 0; + int isolated = 0, result = 0; unsigned long hstart, hend; struct mem_cgroup *memcg; unsigned long mmun_start; /* For mmu_notifiers */