Skip to content

Commit e7d7db4

Browse files
kirylsfrothwell
authored andcommitted
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 <[email protected]> Cc: Ebru Akagunduz <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 8a07d3f commit e7d7db4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/huge_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ static void collapse_huge_page(struct mm_struct *mm,
25942594
pgtable_t pgtable;
25952595
struct page *new_page;
25962596
spinlock_t *pmd_ptl, *pte_ptl;
2597-
int isolated, result = 0;
2597+
int isolated = 0, result = 0;
25982598
unsigned long hstart, hend;
25992599
struct mem_cgroup *memcg;
26002600
unsigned long mmun_start; /* For mmu_notifiers */

0 commit comments

Comments
 (0)