Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[pandora-kernel.git] / drivers / net / tulip / eeprom.c
index 5ffbd5b..0dcced1 100644 (file)
@@ -1,7 +1,6 @@
 /*
        drivers/net/tulip/eeprom.c
 
-       Maintained by Jeff Garzik <jgarzik@pobox.com>
        Copyright 2000,2001  The Linux Kernel Team
        Written/copyright 1994-2001 by Donald Becker.
 
@@ -9,9 +8,8 @@
        of the GNU General Public License, incorporated herein by reference.
 
        Please refer to Documentation/DocBook/tulip-user.{pdf,ps,html}
-       for more information on this driver, or visit the project
-       Web page at http://sourceforge.net/projects/tulip/
-
+       for more information on this driver.
+       Please submit bug reports to http://bugzilla.kernel.org/.
 */
 
 #include <linux/pci.h>
@@ -343,6 +341,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);