Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP collapse support

From: Lorenzo Stoakes

Date: Thu Jun 04 2026 - 06:18:21 EST


Not sure if already addressed for v19 but I just tried building a kernel in
mm-unstable and saw this (clang 22.1.6):

mm/khugepaged.c:1357:6: warning: variable 'pte' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1357 | if (result != SCAN_SUCCEED)
| ^~~~~~~~~~~~~~~~~~~~~~
mm/khugepaged.c:1458:6: note: uninitialized use occurs here
1458 | if (pte)
| ^~~
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;
| ~~~~~~~~~~~~~~~~~
mm/khugepaged.c:1352:6: warning: variable 'pte' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1352 | if (result != SCAN_SUCCEED)
| ^~~~~~~~~~~~~~~~~~~~~~
mm/khugepaged.c:1458:6: note: uninitialized use occurs here
1458 | if (pte)
| ^~~
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;
| ~~~~~~~~~~~~~~~~~
mm/khugepaged.c:1296:12: note: initialize the variable 'pte' to silence this warning
1296 | pte_t *pte;
| ^
| = NULL
2 warnings generated.


Is this already addressed in v19/review here? If not could you please address it.

Thanks, Lorenzo