git: e24a14c4c361 - stable/14 - ixgbe: Avoid signed overflow in LED register masks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 25 Aug 2026 00:42:55 UTC
The branch stable/14 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=e24a14c4c3613a8163b1a005062ed141a2ef79e8
commit e24a14c4c3613a8163b1a005062ed141a2ef79e8
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-11 19:34:50 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-25 00:41:19 +0000
ixgbe: Avoid signed overflow in LED register masks
LED index three shifts the blink bit into bit 31. Convert the base to
the register width before shifting so the operation is unsigned.
This is the ixgbe counterpart of the e1000 correction imported from
DPDK commit 214cb0d7f1.
(cherry picked from commit bbdd3c4692e2869817f77c359b4a2719e716921d)
---
sys/dev/ixgbe/ixgbe_type.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h
index 4c146aadc581..85190dc59fdb 100644
--- a/sys/dev/ixgbe/ixgbe_type.h
+++ b/sys/dev/ixgbe/ixgbe_type.h
@@ -2228,7 +2228,7 @@ enum {
#define IXGBE_LED_IVRT_BASE 0x00000040
#define IXGBE_LED_BLINK_BASE 0x00000080
#define IXGBE_LED_MODE_MASK_BASE 0x0000000F
-#define IXGBE_LED_OFFSET(_base, _i) (_base << (8 * (_i)))
+#define IXGBE_LED_OFFSET(_base, _i) ((u32)(_base) << (8 * (_i)))
#define IXGBE_LED_MODE_SHIFT(_i) (8*(_i))
#define IXGBE_LED_IVRT(_i) IXGBE_LED_OFFSET(IXGBE_LED_IVRT_BASE, _i)
#define IXGBE_LED_BLINK(_i) IXGBE_LED_OFFSET(IXGBE_LED_BLINK_BASE, _i)