Skip to content

Commit

Permalink
khugepaged: avoid usage of uninitialized variable 'isolated'
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kiryl authored and sfrothwell committed Jan 13, 2016
1 parent bcf8e66 commit f354c14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/huge_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f354c14

Please sign in to comment.