Commit 629d9d1c authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Torvalds

mm: avoid uninitialized variable in tracepoint

A newly added tracepoint in the hugepage code uses a variable in the
error handling that is not initialized at that point:

include/trace/events/huge_memory.h:81:230: error: 'isolated' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The result is relatively harmless, as the trace data will in rare
cases contain incorrect data.

This works around the problem by adding an explicit initialization.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 7d2eba05 ("mm: add tracepoint for scanning pages")
Reviewed-by: default avatarEbru Akagunduz <ebru.akagunduz@gmail.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2b4015e9
...@@ -2320,7 +2320,7 @@ static void collapse_huge_page(struct mm_struct *mm, ...@@ -2320,7 +2320,7 @@ static void collapse_huge_page(struct mm_struct *mm,
pgtable_t pgtable; pgtable_t pgtable;
struct page *new_page; struct page *new_page;
spinlock_t *pmd_ptl, *pte_ptl; spinlock_t *pmd_ptl, *pte_ptl;
int isolated, result = 0; int isolated = 0, result = 0;
unsigned long hstart, hend; unsigned long hstart, hend;
struct mem_cgroup *memcg; struct mem_cgroup *memcg;
unsigned long mmun_start; /* For mmu_notifiers */ unsigned long mmun_start; /* For mmu_notifiers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment