diff options
author | David S. Miller <davem@davemloft.net> | 2008-03-28 19:44:58 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-28 19:44:58 -0700 |
commit | 98846b5e2363e96a2b821e211bf0169afb38a54a (patch) | |
tree | 7548a8de8c96e089a8e2687ecbe07c58c5ea8371 /drivers/net/tulip/eeprom.c | |
parent | e8e16b706e8406f1ab3bccab16932ebc513896d8 (diff) | |
parent | bd6ca6375b9f18f40e814f391d9d1abaa916bc72 (diff) |
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers/net/tulip/eeprom.c')
-rw-r--r-- | drivers/net/tulip/eeprom.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c index 206918bad53..da2206f6021 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 void __iomem *ee_addr = tp->base_addr + CSR9; int read_cmd = location | (EE_READ_CMD << addr_len); + /* If location is past the end of what we can address, don't + * read some other location (ie truncate). Just return zero. + */ + if (location > (1 << addr_len) - 1) + return 0; + iowrite32(EE_ENB & ~EE_CS, ee_addr); iowrite32(EE_ENB, ee_addr); |