Skip to contentSkip to conversation

net/e1000: fix eeprom dump failure

PATCH Applied Yuan Wang 2 participants 2 messages Apr 15, 2025 – Apr 28, 2025 Network drivers

lore
Share & tools
lore

Yuan Wang

author
#0 lore raw

PATCH 1/1 net/e1000: fix eeprom dump failure

There is a incorrect comparison in get_eeprom that cause epprom dump fail. This patch fixes this issue.

Fixes 83c314da4c38 (igb: add access to specific device info)
---
 drivers/net/intel/e1000/igb_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/e1000/igb_ethdev.c +1 -1
index cbd2f15f5f..738c0ef895 100644
@@ -5219,7 +5219,7 @@ eth_igb_get_eeprom(struct rte_eth_dev *dev,
 	first = in_eeprom->offset >> 1;
 	length = in_eeprom->length >> 1;
 	if ((first >= hw->nvm.word_size) ||
-	    ((first + length) >= hw->nvm.word_size))
+	    ((first + length) > hw->nvm.word_size))
 		return -EINVAL;
 
 	in_eeprom->magic = hw->vendor_id |
Signature · 1 line
2.47.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 16 lines · Yuan Wang

There is a incorrect comparison in get_eeprom that cause epprom dump fail. This patch fixes this issue.

Fixes 83c314da4c38 (igb: add access to specific device info)
---
 drivers/net/intel/e1000/igb_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/e1000/igb_ethdev.c +0 -0
index cbd2f15f5f..738c0ef895 100644

drivers/net/intel/e1000/igb_ethdev.c eth_igb_get_eeprom(struct rte_eth_dev *dev, · line 5224

Quoted 7 lines
drivers/net/intel/e1000/igb_ethdev.c +1 -1
@@ -5219,7 +5219,7 @@ eth_igb_get_eeprom(struct rte_eth_dev *dev,
 	first = in_eeprom->offset >> 1;
 	length = in_eeprom->length >> 1;
 	if ((first >= hw->nvm.word_size) ||
-	    ((first + length) >= hw->nvm.word_size))
+	    ((first + length) > hw->nvm.word_size))
 		return -EINVAL;
 

Fix makes sense.

Applied to dpdk-next-net-intel

Thanks,
/Bruce