From 70bc9e5f2cde767e0d6b6fff7525d26b9b06845c Mon Sep 17 00:00:00 2001 From: vangyzen Date: Sat, 26 May 2018 14:01:44 +0000 Subject: [PATCH] kdb_trap: Fix use of uninitialized data In some cases, other_cpus was used without being initialized. Thankfully, it was harmless. Reported by: Coverity CID: 1385265 Sponsored by: Dell EMC --- sys/kern/subr_kdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index dfaf466d2ca0..d220ca45c401 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -708,9 +708,10 @@ kdb_trap(int type, int code, struct trapframe *tf) kdb_active--; #ifdef SMP - CPU_AND(&other_cpus, &stopped_cpus); - if (did_stop_cpus) + if (did_stop_cpus) { + CPU_AND(&other_cpus, &stopped_cpus); restart_cpus(other_cpus); + } #endif intr_restore(intr);