X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Ftulip%2Feeprom.c;h=da2206f6021d9881f9bfc362c1d93890c735baf5;hb=448504130f18bc9d8d10ba045775c906abd01438;hp=5ffbd5b300c0d524c4baefaf3b373cdce6dc2e20;hpb=fffcb480e4224f25c965b93fa65541bfc7dd732e;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c index 5ffbd5b300c..da2206f6021 100644 --- a/drivers/net/tulip/eeprom.c +++ b/drivers/net/tulip/eeprom.c @@ -1,7 +1,7 @@ /* drivers/net/tulip/eeprom.c - Maintained by Jeff Garzik + Maintained by Valerie Henson Copyright 2000,2001 The Linux Kernel Team Written/copyright 1994-2001 by Donald Becker. @@ -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);