Skip to contentSkip to conversation

linux-next: build failure after merge of the mm-unstable tree

PATCH Mark Brown 2 participants 2 messages Jun 3

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

After merging the mm-unstable tree, today's linux-next build (x86_64 allmodconfig) failed like this:

/tmp/next/build/mm/khugepaged.c:1357:6: error: variable 'pte' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
1357 | if (result != SCAN_SUCCEED)

      |             ^~~~~~~~~~~~~~~~~~~~~~

/tmp/next/build/mm/khugepaged.c:1458:6: note: uninitialized use occurs here
1458 | if (pte)
| ^~~
/tmp/next/build/mm/khugepaged.c:1357:2: note: remove the 'if' if its condition is always false

 1357 |         if (result != SCAN_SUCCEED)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 1358 |                 goto out_up_write;
      |                 ~~~~~~~~~~~~~~~~~
/tmp/next/build/mm/khugepaged.c:1352:6: error: variable 'pte' is used uninitialized whenever 'if' condition is true
[-Werror,-Wsometimes-uninitialized]
 1352 |         if (result != SCAN_SUCCEED)
      |             ^~~~~~~~~~~~~~~~~~~~~~

/tmp/next/build/mm/khugepaged.c:1458:6: note: uninitialized use occurs here
1458 | if (pte)
| ^~~
/tmp/next/build/mm/khugepaged.c:1352:2: note: remove the 'if' if its condition is always false

 1352 |         if (result != SCAN_SUCCEED)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 1353 |                 goto out_up_write;
      |                 ~~~~~~~~~~~~~~~~~
/tmp/next/build/mm/khugepaged.c:1296:12: note: initialize the variable 'pte' to silence this warning
 1296 |         pte_t *pte;
      |                   ^
      |                    = NULL

2 errors generated.

Caused by this diff:

mm/khugepaged.c +1 -1
index 8ffb47f1e8453..2837f12618583 100644
@@ -1293,7 +1293,7 @@ static enum scan_result collapse_huge_page(struct mm_struct *mm, unsigned long s
        const unsigned long end_addr = start_addr + (PAGE_SIZE << order);
        LIST_HEAD(compound_pagelist);
        pmd_t *pmd, _pmd;
-       pte_t *pte = NULL;
+       pte_t *pte;
        pgtable_t pgtable;
        struct folio *folio;
        spinlock_t *pmd_ptl, *pte_ptl;

which git annotate is getting very confused about the source of unless it's a dropped commit. I have reverted that hunk.

maintainer
#1 lore raw
Quoted 11 lines · On Wed, 3 Jun 2026 10:39:14 +0100 Mark Brown <[email protected]> wrote:

After merging the mm-unstable tree, today's linux-next build (x86_64 allmodconfig) failed like this:

/tmp/next/build/mm/khugepaged.c:1357:6: error: variable 'pte' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
1357 | if (result != SCAN_SUCCEED)

      |             ^~~~~~~~~~~~~~~~~~~~~~

/tmp/next/build/mm/khugepaged.c:1458:6: note: uninitialized use occurs here
1458 | if (pte)
| ^~~
/tmp/next/build/mm/khugepaged.c:1357:2: note: remove the 'if' if its condition is always false

Quoted 7 lines
 1357 |         if (result != SCAN_SUCCEED)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 1358 |                 goto out_up_write;
      |                 ~~~~~~~~~~~~~~~~~

/tmp/next/build/mm/khugepaged.c:1352:6: error: variable 'pte' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
1352 | if (result != SCAN_SUCCEED)

Dunno, really - perhaps I fed you some intermediate state. Everything looks OK here so it should come good.