git: 10783f288172 - releng/14.5 - ocf_fc: Fix up max() usage
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 Nov 2026 17:05:06 UTC
The branch releng/14.5 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=10783f2881726bfa05c1bb6dbbc795d2338b7b26
commit 10783f2881726bfa05c1bb6dbbc795d2338b7b26
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-10-27 16:47:19 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-16 21:17:12 +0000
ocf_fc: Fix up max() usage
max() truncates its parameters to 32-bit integers.
Approved by: so
Security: FreeBSD-SA-26:76.ocs_fc
Reviewed by: ram
Sponsored by: The FreeBSD Foundation
Fixes: 26081296b244 ("ocs_fc: Harden ioctl, XRI lookup and FCP command validation")
(cherry picked from commit 9b6b3a36ee295dc6edd0e00aa34adaebaed98c7d)
(cherry picked from commit 5f5d5abc37d096264c1bb33feb8f9ea62c4f3000)
---
sys/dev/ocs_fc/ocs_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/ocs_fc/ocs_ioctl.c b/sys/dev/ocs_fc/ocs_ioctl.c
index 18dd3fbbac4c..9193f4168c5a 100644
--- a/sys/dev/ocs_fc/ocs_ioctl.c
+++ b/sys/dev/ocs_fc/ocs_ioctl.c
@@ -194,7 +194,7 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbox_t *mcmd, ocs_dma_t *dma)
break;
}
} else {
- uint64_t max_bytes = max(mcmd->in_bytes, mcmd->out_bytes);
+ uint64_t max_bytes = MAX(mcmd->in_bytes, mcmd->out_bytes);
if (max_bytes > OCS_MAX_DMA_ALLOC) {
device_printf(ocs->dev, "%s: non-embedded - %llu exceeds max\n",
__func__, (unsigned long long)max_bytes);