From 1c12d03f5e3c52ddd44feb2a5be1bd29ea48ab8c Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Tue, 30 Apr 2013 14:56:41 +0000 Subject: [PATCH] Complete r250097: Do not change the initialization order in pmc_intel_initialize(). --- sys/dev/hwpmc/hwpmc_intel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_intel.c b/sys/dev/hwpmc/hwpmc_intel.c index 62a1e522561..026196c5c20 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);