svn commit: r348740 - head/sys/dev/hwpmc

Ian Lepore ian at FreeBSD.org
Thu Jun 6 15:18:24 UTC 2019


Author: ian
Date: Thu Jun  6 15:18:23 2019
New Revision: 348740
URL: https://svnweb.freebsd.org/changeset/base/348740

Log:
  Don't refer to the cpu variable in a KASSERT before initializing it.

Modified:
  head/sys/dev/hwpmc/hwpmc_armv7.c

Modified: head/sys/dev/hwpmc/hwpmc_armv7.c
==============================================================================
--- head/sys/dev/hwpmc/hwpmc_armv7.c	Thu Jun  6 15:11:36 2019	(r348739)
+++ head/sys/dev/hwpmc/hwpmc_armv7.c	Thu Jun  6 15:18:23 2019	(r348740)
@@ -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++) {


More information about the svn-src-all mailing list