Page MenuHomeFreeBSD

x86/ucode: fix gcc uninitialised warning
ClosedPublic

Authored by adrian on Feb 22 2026, 4:17 PM.
Tags
None
Referenced Files
F160695445: D55439.diff
Fri, Jun 26, 9:30 PM
F160695431: D55439.diff
Fri, Jun 26, 9:30 PM
Unknown Object (File)
Tue, Jun 9, 9:30 PM
Unknown Object (File)
May 23 2026, 3:23 PM
Unknown Object (File)
May 21 2026, 8:54 PM
Unknown Object (File)
May 17 2026, 6:19 PM
Unknown Object (File)
May 17 2026, 6:12 PM
Unknown Object (File)
May 14 2026, 2:52 PM
Subscribers

Details

Summary

This fixes the case where selected_size is never set to anything
in the loop. Whilst here, also set selected_fw to NULL so the case
of "no firmware" correctly sets everything to NULL/0.

  --- ucode_subr.o ---
  /workspace/src/sys/x86/x86/ucode_subr.c: In function 'ucode_amd_find':
  /workspace/src/sys/x86/x86/ucode_subr.c:237:25: warning: 'selected_size' may be used uninitialized [-Wmaybe-uninitialized]
    237 |         *selected_sizep = selected_size;
        |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/  workspace/src/sys/x86/x86/ucode_subr.c:105:16: note: 'selected_size' was declared here
    105 |         size_t selected_size;
        |                ^~~~~~~~~~~~~

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable