Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2019 15:18:23 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r348740 - head/sys/dev/hwpmc
Message-ID:  <201906061518.x56FINrQ040427@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906061518.x56FINrQ040427>