Skip to content

Commit

Permalink
igb: Add check for invalid size to igb_get_invariants_82575()
Browse files Browse the repository at this point in the history
Recent commits have changed how EEPROM size is checked and if the size
word is misconfigured, the driver will fail to load.  This patch adds a
check for invalid size word in the EEPROM and uses default size instead
for 82576 parts.

Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Carolyn Wyborny authored and Jeff Kirsher committed May 4, 2011
1 parent ec7e97e commit f6b1bfd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/igb/e1000_82575.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
*/
size += NVM_WORD_SIZE_BASE_SHIFT;

/*
* Check for invalid size
*/
if ((hw->mac.type == e1000_82576) && (size > 15)) {
printk("igb: The NVM size is not valid, "
"defaulting to 32K.\n");
size = 15;
}
nvm->word_size = 1 << size;
if (nvm->word_size == (1 << 15))
nvm->page_size = 128;
Expand Down

0 comments on commit f6b1bfd

Please sign in to comment.