diff options
author | jhb <jhb@FreeBSD.org> | 2003-12-10 19:28:37 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-12-10 19:28:37 +0000 |
commit | ee85536e88fd269603b37a6d9775a8fc66590be6 (patch) | |
tree | 348c2cc88d722bb8a711007f53b4ca98cbe94dfb | |
parent | 869e10c88c600adc3c7bbb0d04efbc3b5c914838 (diff) | |
download | FreeBSD-src-ee85536e88fd269603b37a6d9775a8fc66590be6.zip FreeBSD-src-ee85536e88fd269603b37a6d9775a8fc66590be6.tar.gz |
Correct usage of MAXCPU. The MAXCPU value itself is not a valid CPU ID
value as it is a count of maximum values.
Reported by: bde
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index a2c4b48..de7e45a 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -232,9 +232,9 @@ void cpu_add(u_int apic_id, char boot_cpu) { - if (apic_id > MAXCPU) { + if (apic_id >= MAXCPU) { printf("SMP: CPU %d exceeds maximum CPU %d, ignoring\n", - apic_id, MAXCPU); + apic_id, MAXCPU - 1); return; } KASSERT(cpu_info[apic_id].cpu_present == 0, ("CPU %d added twice", |