git: 911fcebfc7f1 - main - hwpmc: return errors from PMC_OP_PMCGETMSR
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 08 Oct 2026 14:58:02 UTC
The branch main has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=911fcebfc7f1e5a5dd184137c0b9d62b4b066f17
commit 911fcebfc7f1e5a5dd184137c0b9d62b4b066f17
Author: Osvaldo Janeri Filho <ojanerif@amd.com>
AuthorDate: 2026-10-08 09:44:00 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-10-08 14:57:40 +0000
hwpmc: return errors from PMC_OP_PMCGETMSR
pcd_get_msr() returns a positive errno, but only a negative value was
treated as a failure, so errors were reported as success.
Signed-off-by: Osvaldo Janeri Filho <ojanerif@amd.com>
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: AMD
Pull Request: https://github.com/freebsd/freebsd-src/pull/2461
---
sys/dev/hwpmc/hwpmc_mod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index 7db73b5c78c9..7ffabee4004f 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -4465,7 +4465,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
break;
}
- if ((error = (*pcd->pcd_get_msr)(adjri, &gm.pm_msr)) < 0)
+ if ((error = (*pcd->pcd_get_msr)(adjri, &gm.pm_msr)) != 0)
break;
if ((error = copyout(&gm, arg, sizeof(gm))) < 0)