Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2018 04:12:51 +0000 (UTC)
From:      Matt Macy <mmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334371 - head/lib/libpmc
Message-ID:  <201805300412.w4U4CpGc081056@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmacy
Date: Wed May 30 04:12:51 2018
New Revision: 334371
URL: https://svnweb.freebsd.org/changeset/base/334371

Log:
  libpmc: squelch valgrind warnings

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==============================================================================
--- head/lib/libpmc/libpmc.c	Wed May 30 03:48:27 2018	(r334370)
+++ head/lib/libpmc/libpmc.c	Wed May 30 04:12:51 2018	(r334371)
@@ -3277,6 +3277,7 @@ pmc_init(void)
 		return (pmc_syscall = -1);
 	}
 
+	bzero(&op_cpu_info, sizeof(op_cpu_info));
 	if (PMC_CALL(GETCPUINFO, &op_cpu_info) < 0)
 		return (pmc_syscall = -1);
 
@@ -3284,7 +3285,7 @@ pmc_init(void)
 	cpu_info.pm_ncpu    = op_cpu_info.pm_ncpu;
 	cpu_info.pm_npmc    = op_cpu_info.pm_npmc;
 	cpu_info.pm_nclass  = op_cpu_info.pm_nclass;
-	for (n = 0; n < cpu_info.pm_nclass; n++)
+	for (n = 0; n < op_cpu_info.pm_nclass; n++)
 		memcpy(&cpu_info.pm_classes[n], &op_cpu_info.pm_classes[n],
 		    sizeof(cpu_info.pm_classes[n]));
 



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