libpmc: don't return -1 on success in pmc_allocate

This commit is contained in:
Matt Macy 2018-05-29 20:09:35 +00:00
parent cbf7e0cba7
commit 1a32aa0ff7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334349

View File

@ -2796,9 +2796,9 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode,
ctrname = strsep(&r, ",");
if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) {
if (PMC_CALL(PMCALLOCATE, &pmc_config) < 0) {
retval = errno;
goto out;
}
retval = 0;
*pmcid = pmc_config.pm_pmcid;
goto out;
} else {