x86/cpu: identify uninitialized CPU data using BAD_APICID

Uninitialized cpu_data[] entries have the apicid field set to BAD_APICID,
not boot_cpu_data.apicid.  Fix the check in cpu_smpboot_free() to use the
correct condition.

Fixes: 7126b7f806 ("x86/CPU: re-work populating of cpu_data[]")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Roger Pau Monne authored and Andrew Cooper committed 2026-05-01 10:51:19 +01:00
1 parent 9e13c0ca18
commit cd0413bfac
1 file changed
+1 -2
+1 -2
View File
@@ -961,8 +961,7 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
* In that case the socket number cannot be relied upon, but the respective
* socket_cpumask[] slot also wouldn't have been set.
*/
if ( c[cpu].apicid != boot_cpu_data.apicid &&
cpumask_empty(socket_cpumask[socket]) )
if ( c[cpu].apicid != BAD_APICID && cpumask_empty(socket_cpumask[socket]) )
{
xfree(socket_cpumask[socket]);
socket_cpumask[socket] = NULL;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.