nexus/intr: Properly assert cpuid for interrupt resources
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 18 Dec 2011 02:17:48 +0000 (10:17 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 18 Dec 2011 02:18:32 +0000 (10:18 +0800)
Noticed-by: Nuno Antunes
sys/platform/pc32/i386/nexus.c
sys/platform/pc64/x86_64/nexus.c

index 92cb4a5..0135d5b 100644 (file)
@@ -355,7 +355,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
 
        switch (type) {
        case SYS_RES_IRQ:
-               KASSERT(cpuid >= 0 || cpuid < ncpus,
+               KASSERT(cpuid >= 0 && cpuid < ncpus,
                    ("nexus invalid cpuid %d:\n", cpuid));
                rm = &irq_rman[cpuid];
                break;
index 156b9b6..020f30f 100644 (file)
@@ -351,7 +351,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
 
        switch (type) {
        case SYS_RES_IRQ:
-               KASSERT(cpuid >= 0 || cpuid < ncpus,
+               KASSERT(cpuid >= 0 && cpuid < ncpus,
                    ("nexus invalid cpuid %d:\n", cpuid));
                rm = &irq_rman[cpuid];
                break;