Page MenuHomeFreeBSD

x86/ucode: fix gcc uninitialised warning
ClosedPublic

Authored by adrian on Feb 22 2026, 4:17 PM.
Tags
None
Referenced Files
F163156057: D55439.id176591.diff
Mon, Jul 20, 2:36 PM
F163106440: D55439.id172448.diff
Mon, Jul 20, 3:25 AM
Unknown Object (File)
Sun, Jul 19, 6:32 AM
Unknown Object (File)
Sun, Jul 19, 6:25 AM
Unknown Object (File)
Wed, Jul 15, 7:09 AM
Unknown Object (File)
Wed, Jul 15, 7:09 AM
Unknown Object (File)
Sun, Jul 5, 3:50 AM
Unknown Object (File)
Fri, Jul 3, 5:43 AM
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