svn commit: r334351 - head/lib/libpmc

Eric van Gyzen vangyzen at FreeBSD.org
Tue May 29 20:30:47 UTC 2018


Author: vangyzen
Date: Tue May 29 20:30:46 2018
New Revision: 334351
URL: https://svnweb.freebsd.org/changeset/base/334351

Log:
  pmc_annotate: adhere to the API
  
  If the 'mode' parameter was invalid, pmc_annotate() would
  return EINVAL instead of setting errno and returning -1.
  
  Sponsored by:	Dell EMC

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==============================================================================
--- head/lib/libpmc/libpmc.c	Tue May 29 20:28:34 2018	(r334350)
+++ head/lib/libpmc/libpmc.c	Tue May 29 20:30:46 2018	(r334351)
@@ -2781,7 +2781,8 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
 
 	if (mode != PMC_MODE_SS && mode != PMC_MODE_TS &&
 	    mode != PMC_MODE_SC && mode != PMC_MODE_TC) {
-		return (EINVAL);
+		errno = EINVAL;
+		goto out;
 	}
 	bzero(&pmc_config, sizeof(pmc_config));
 	pmc_config.pm_cpu   = cpu;


More information about the svn-src-all mailing list