diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-04-19 17:17:29 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 17:17:29 +0100 |
commit | adf6d34e460387ee3e8f1e1875d52bff51212c7d (patch) | |
tree | 88ef100143e6184103a608f82dfd232bf6376eaf /drivers/net/tulip/eeprom.c | |
parent | d1964dab60ce7c104dd21590e987a8787db18051 (diff) | |
parent | 3760d31f11bfbd0ead9eaeb8573e0602437a9d7c (diff) |
Merge branch 'omap2-upstream' into devel
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); |