[PATCH 03/10] net/e1000/base: fix possible variable overflow

Ciara Loftus ciara.loftus at intel.com
Wed May 20 14:52:40 CEST 2026


From: Lukasz Czapnik <lukasz.czapnik at intel.com>

Bits can be lost as temporary math is done on signed variables and the
result is assigned to an unsigned variable. Cast to u32 to force the
compiler to do operations on unsigned temporary variables.

Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org

Signed-off-by: Lukasz Czapnik <lukasz.czapnik at intel.com>
Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
---
 drivers/net/intel/e1000/base/e1000_mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/intel/e1000/base/e1000_mac.c b/drivers/net/intel/e1000/base/e1000_mac.c
index 41aae86ffe..408e8e46e8 100644
--- a/drivers/net/intel/e1000/base/e1000_mac.c
+++ b/drivers/net/intel/e1000/base/e1000_mac.c
@@ -1970,7 +1970,7 @@ s32 e1000_blink_led_generic(struct e1000_hw *hw)
 			     (mode == E1000_LEDCTL_MODE_LED_OFF))) {
 				ledctl_blink &=
 				    ~(E1000_LEDCTL_LED0_MODE_MASK << i);
-				ledctl_blink |= (E1000_LEDCTL_LED0_BLINK |
+				ledctl_blink |= (u32)(E1000_LEDCTL_LED0_BLINK |
 						 E1000_LEDCTL_MODE_LED_ON) << i;
 			}
 		}
-- 
2.43.0



More information about the stable mailing list