git: 9b6b3a36ee29 - main - ocf_fc: Fix up max() usage
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 28 Oct 2026 13:07:21 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=9b6b3a36ee295dc6edd0e00aa34adaebaed98c7d
commit 9b6b3a36ee295dc6edd0e00aa34adaebaed98c7d
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-10-27 16:47:19 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-10-28 13:06:58 +0000
ocf_fc: Fix up max() usage
max() truncates its parameters to 32-bit integers.
Reviewed by: ram
Sponsored by: The FreeBSD Foundation
Fixes: 26081296b244 ("ocs_fc: Harden ioctl, XRI lookup and FCP command validation")
---
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);