aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_kdb.c
diff options
context:
space:
mode:
authorEric van Gyzen <vangyzen@FreeBSD.org>2018-05-26 14:01:44 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2018-05-26 14:01:44 +0000
commit16b51429d2a050131ed8ca29f2beb2ac4cd94dc4 (patch)
treec787d485d124a75c79675d2b4dac39d7a6fdbfc6 /sys/kern/subr_kdb.c
parenta4ccdf9091852d0bbe5b2057de7d66c21a855ae1 (diff)
downloadsrc-16b51429d2a050131ed8ca29f2beb2ac4cd94dc4.tar.gz
src-16b51429d2a050131ed8ca29f2beb2ac4cd94dc4.zip
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
Notes
Notes: svn path=/head/; revision=334238
Diffstat (limited to 'sys/kern/subr_kdb.c')
-rw-r--r--sys/kern/subr_kdb.c5
1 files 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);