pmc_*_initialize may return NULL if the CPU is not supported, so check

that md is not null before dereferencing it.

PR:		kern/156540
This commit is contained in:
Ed Maste 2012-01-28 01:38:48 +00:00
parent a3681f9010
commit 158c4475c8

View File

@ -250,7 +250,7 @@ pmc_md_initialize()
return (NULL);
/* disallow sampling if we do not have an LAPIC */
if (!lapic_enable_pmc())
if (md != NULL && !lapic_enable_pmc())
for (i = 1; i < md->pmd_nclass; i++)
md->pmd_classdep[i].pcd_caps &= ~PMC_CAP_INTERRUPT;