aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/eeprom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip/eeprom.c')
-rw-r--r--drivers/net/tulip/eeprom.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 206918bad539..da2206f6021d 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -343,6 +343,12 @@ int __devinit tulip_read_eeprom(struct net_device *dev, int location, int addr_l
343 void __iomem *ee_addr = tp->base_addr + CSR9; 343 void __iomem *ee_addr = tp->base_addr + CSR9;
344 int read_cmd = location | (EE_READ_CMD << addr_len); 344 int read_cmd = location | (EE_READ_CMD << addr_len);
345 345
346 /* If location is past the end of what we can address, don't
347 * read some other location (ie truncate). Just return zero.
348 */
349 if (location > (1 << addr_len) - 1)
350 return 0;
351
346 iowrite32(EE_ENB & ~EE_CS, ee_addr); 352 iowrite32(EE_ENB & ~EE_CS, ee_addr);
347 iowrite32(EE_ENB, ee_addr); 353 iowrite32(EE_ENB, ee_addr);
348 354