Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2012 14:54:30 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r239433 - stable/9/sys/dev/hwpmc
Message-ID:  <201208201454.q7KEsUng049799@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Mon Aug 20 14:54:30 2012
New Revision: 239433
URL: http://svn.freebsd.org/changeset/base/239433

Log:
  MFC r230636:
  
    pmc_*_initialize may return NULL if the CPU is not supported, so check
    that md is not null before dereferencing it.
  
  PR:             kern/156540

Modified:
  stable/9/sys/dev/hwpmc/hwpmc_x86.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/hwpmc/hwpmc_x86.c
==============================================================================
--- stable/9/sys/dev/hwpmc/hwpmc_x86.c	Mon Aug 20 14:52:43 2012	(r239432)
+++ stable/9/sys/dev/hwpmc/hwpmc_x86.c	Mon Aug 20 14:54:30 2012	(r239433)
@@ -252,7 +252,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 = 0; i < md->pmd_nclass; i++) {
 			if (i == PMC_CLASS_INDEX_SOFT)
 				continue;



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