From fbc27301ba4280886011dfb924c78402829b57cc Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Thu, 6 Jun 2019 15:18:23 +0000 Subject: [PATCH] Don't refer to the cpu variable in a KASSERT before initializing it. --- sys/dev/hwpmc/hwpmc_armv7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/hwpmc/hwpmc_armv7.c b/sys/dev/hwpmc/hwpmc_armv7.c index 0a601145f8de..c43f2786655d 100644 --- a/sys/dev/hwpmc/hwpmc_armv7.c +++ b/sys/dev/hwpmc/hwpmc_armv7.c @@ -315,11 +315,11 @@ armv7_intr(struct trapframe *tf) int error; int reg, cpu; + cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[armv7,%d] CPU %d out of range", __LINE__, cpu)); retval = 0; - cpu = curcpu; pc = armv7_pcpu[cpu]; for (ri = 0; ri < armv7_npmcs; ri++) {