Fix crash on VirtualBox (and probably on some real hardware):
- Do not cover error returned by pmc_core_initialize with the result of pmc_uncore_initialize, fail right away. - Give a user something to report instead failing silently Reported by: Alexandr Kovalenko <never@nevermind.kiev.ua>
This commit is contained in:
parent
1da5145831
commit
edf893b531
@ -2406,8 +2406,12 @@ pmc_core_initialize(struct pmc_mdep *md, int maxcpu)
|
||||
PMCDBG(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d",
|
||||
md->pmd_cputype, maxcpu, ipa_version);
|
||||
|
||||
if (ipa_version < 1 || ipa_version > 3) /* Unknown PMC architecture. */
|
||||
if (ipa_version < 1 || ipa_version > 3) {
|
||||
/* Unknown PMC architecture. */
|
||||
printf("hwpc_core: unknown PMC architecture: %d\n",
|
||||
ipa_version);
|
||||
return (EPROGMISMATCH);
|
||||
}
|
||||
|
||||
core_cputype = md->pmd_cputype;
|
||||
|
||||
|
@ -239,6 +239,9 @@ pmc_intel_initialize(void)
|
||||
KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__));
|
||||
}
|
||||
|
||||
if (error)
|
||||
goto error;
|
||||
|
||||
/*
|
||||
* Init the uncore class.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user