mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
The `reg` value was never initialized, so the loop could potentially
abort without a single read of the register. This was found by the
following warning from GCC:
sys/dev/thunderbolt/nhi.c: In function 'nhi_reset_v2':
sys/dev/thunderbolt/nhi.c:272:35: error: 'reg' is used uninitialized [-Werror=uninitialized]
272 | for (size_t i = 0; i < 10 && reg; i++) {
| ^~
sys/dev/thunderbolt/nhi.c:257:18: note: 'reg' was declared here
257 | uint32_t reg;
| ^~~
Reported by: GCC 15
Fixes: efdb824139 ("thunderbolt: Reset controllers")