Commit 32a4ec97 authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Jeff Garzik

[PATCH] e1000: Fix invalid memory reference

Fix an invalid memory reference in the e1000 driver which would cause
kernel panic.
Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Jeb Cramer <cramerj@intel.com>
Cc: John Ronciak <john.ronciak@intel.com>
Cc: Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Acked-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 504ddff4
...@@ -545,7 +545,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter) ...@@ -545,7 +545,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter)
static void __devinit static void __devinit
e1000_check_copper_options(struct e1000_adapter *adapter) e1000_check_copper_options(struct e1000_adapter *adapter)
{ {
int speed, dplx; int speed, dplx, an;
int bd = adapter->bd_number; int bd = adapter->bd_number;
{ /* Speed */ { /* Speed */
...@@ -641,8 +641,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter) ...@@ -641,8 +641,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
.p = an_list }} .p = an_list }}
}; };
int an = AutoNeg[bd]; if (num_AutoNeg > bd) {
an = AutoNeg[bd];
e1000_validate_option(&an, &opt, adapter); e1000_validate_option(&an, &opt, adapter);
} else {
an = opt.def;
}
adapter->hw.autoneg_advertised = an; adapter->hw.autoneg_advertised = an;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment