Skip to contentSkip to conversation

Typo in drivers/net/e1000/e1000_hw.c

PATCH In review Eric Sesterhenn 2 participants 2 messages Jun 28, 2006 – Jul 2, 2006 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Typo in drivers/net/e1000/e1000_hw.c

hi,

spotted by coverity (id #539), we should use the define with which the array is defined. We use min_agc as index for e1000_igp_2_cable_length_table[IGP02E1000_AGC_LENGTH_TABLE_SIZE] This patch also adds the -1 to make it safe so that we dont read past the end of the array.

drivers/net/e1000/e1000_hw.c renamed from drivers/net/e1000/e1000_hw.c.orig +1 -1
@@ -6012,7 +6012,7 @@ e1000_get_cable_length(struct e1000_hw *
 {
     int32_t ret_val;
     uint16_t agc_value = 0;
-    uint16_t cur_agc, min_agc = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
+    uint16_t cur_agc, min_agc = IGP02E1000_AGC_LENGTH_TABLE_SIZE - 1;
     uint16_t max_agc = 0;
     uint16_t i, phy_data;
     uint16_t cable_length;
#1 lore raw
Quoted 24 lines · Eric Sesterhenn

hi,

spotted by coverity (id #539), we should use the define with which the array is defined. We use min_agc as index for e1000_igp_2_cable_length_table[IGP02E1000_AGC_LENGTH_TABLE_SIZE] This patch also adds the -1 to make it safe so that we dont read past the end of the array.

drivers/net/e1000/e1000_hw.c 2006-06-28 21:47:07.000000000 +0200 renamed from drivers/net/e1000/e1000_hw.c.orig 2006-06-28 21:46:55.000000000 +0200 +1 -2
@@ -6012,7 +6012,7 @@ e1000_get_cable_length(struct e1000_hw *
 {
     int32_t ret_val;
     uint16_t agc_value = 0;
-    uint16_t cur_agc, min_agc = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
+    uint16_t cur_agc, min_agc = IGP02E1000_AGC_LENGTH_TABLE_SIZE - 1;
     uint16_t max_agc = 0;
     uint16_t i, phy_data;
     uint16_t cable_length;
 
 
-
Quoted 5 lines

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

NACK. This is corrected in the latest patch series that Auke submitted to the kernel. The correction is in [PATCH 18/21] e1000:
integrate ich8 support into driver.

Signature · 2 lines
Cheers,
Jeff