e1000e: limit EEPROM size accesses
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 2 Apr 2008 20:48:07 +0000 (13:48 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 17 Apr 2008 00:41:36 +0000 (20:41 -0400)
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/e1000e/82571.c
drivers/net/e1000e/es2lan.c

index f7e1619b974ee73e508218c0c441fce5a0d2b155..9b46a00bb5f1fbcac4730122a9ad145b5fdec55c 100644 (file)
@@ -171,6 +171,10 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
                 * for setting word_size.
                 */
                size += NVM_WORD_SIZE_BASE_SHIFT;
+
+               /* EEPROM access above 16k is unsupported */
+               if (size > 14)
+                       size = 14;
                nvm->word_size  = 1 << size;
                break;
        }
index e3f4aeefeae27cf39b4502e9c5cf458c4c0474d4..2689e4b83f9bba21ecdd02b90e16dbb2281dfc8f 100644 (file)
@@ -178,6 +178,10 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
         * for setting word_size.
         */
        size += NVM_WORD_SIZE_BASE_SHIFT;
+
+       /* EEPROM access above 16k is unsupported */
+       if (size > 14)
+               size = 14;
        nvm->word_size  = 1 << size;
 
        return 0;