aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-11 19:34:50 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-11 20:59:33 +0000
commitbbdd3c4692e2869817f77c359b4a2719e716921d (patch)
tree8032404b6a434fe727019bfc2ffec59358493857
parentbaa6e3af8525244e65a404fa13306fbca7feae9c (diff)
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. MFC after: 2 weeks
-rw-r--r--sys/dev/ixgbe/ixgbe_type.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h
index 4986673b65c4..9222d8d54fd0 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)