summaryrefslogtreecommitdiffstats
path: root/sys/dev/hwpmc
diff options
context:
space:
mode:
authordavide <davide@FreeBSD.org>2013-04-30 14:56:41 +0000
committerdavide <davide@FreeBSD.org>2013-04-30 14:56:41 +0000
commit70ee3bdcde63fc9f4132e3c50963b350c78b8829 (patch)
treebee2d91c72a58a16405cd5d1a61938d115dda433 /sys/dev/hwpmc
parent30e9f694decd789531840b7b08415af9fbe45159 (diff)
downloadFreeBSD-src-70ee3bdcde63fc9f4132e3c50963b350c78b8829.zip
FreeBSD-src-70ee3bdcde63fc9f4132e3c50963b350c78b8829.tar.gz
Complete r250097:
Do not change the initialization order in pmc_intel_initialize().
Diffstat (limited to 'sys/dev/hwpmc')
-rw-r--r--sys/dev/hwpmc/hwpmc_intel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c
index 62a1e52..026196c 100644
--- a/sys/dev/hwpmc/hwpmc_intel.c
+++ b/sys/dev/hwpmc/hwpmc_intel.c
@@ -191,7 +191,9 @@ pmc_intel_initialize(void)
pmc_mdep->pmd_switch_out = intel_switch_out;
ncpus = pmc_cpu_max();
-
+ error = pmc_tsc_initialize(pmc_mdep, ncpus);
+ if (error)
+ goto error;
switch (cputype) {
#if defined(__i386__) || defined(__amd64__)
/*
@@ -246,8 +248,10 @@ pmc_intel_initialize(void)
KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__));
}
- if (error)
+ if (error) {
+ pmc_tsc_finalize(pmc_mdep);
goto error;
+ }
/*
* Init the uncore class.
@@ -267,7 +271,6 @@ pmc_intel_initialize(void)
break;
}
#endif
- error = pmc_tsc_initialize(pmc_mdep, ncpus);
error:
if (error) {
pmc_mdep_free(pmc_mdep);
OpenPOWER on IntegriCloud