git: 949ebebce4bb - stable/15 - hwpmc: return errors from PMC_OP_PMCGETMSR
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 30 Oct 2026 14:05:48 UTC
The branch stable/15 has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=949ebebce4bb22b5253aee93ed48391c4fdd91b4
commit 949ebebce4bb22b5253aee93ed48391c4fdd91b4
Author: Osvaldo Janeri Filho <ojanerif@amd.com>
AuthorDate: 2026-10-08 09:44:00 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-10-30 14:05:05 +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
(cherry picked from commit 911fcebfc7f1e5a5dd184137c0b9d62b4b066f17)
---
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 de6beb165c66..c5771f8a0fe7 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -4375,7 +4375,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)