aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2006-01-06 01:45:44 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-09 10:54:48 -0500
commit32a4ec97461f00aa63747fc8978011ea771bd543 (patch)
tree0b9076b1374433d11e7ed89caf4e01703f87960a
parent504ddff4c0b8e31fa2a2775d6d484faeb126a265 (diff)
[PATCH] e1000: Fix invalid memory reference
Fix an invalid memory reference in the e1000 driver which would cause kernel panic. Signed-off-by: Kenji 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: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/e1000/e1000_param.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 38695d5b4637..ccbbe5ad8e0f 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -545,7 +545,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter)
545static void __devinit 545static void __devinit
546e1000_check_copper_options(struct e1000_adapter *adapter) 546e1000_check_copper_options(struct e1000_adapter *adapter)
547{ 547{
548 int speed, dplx; 548 int speed, dplx, an;
549 int bd = adapter->bd_number; 549 int bd = adapter->bd_number;
550 550
551 { /* Speed */ 551 { /* Speed */
@@ -641,8 +641,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
641 .p = an_list }} 641 .p = an_list }}
642 }; 642 };
643 643
644 int an = AutoNeg[bd]; 644 if (num_AutoNeg > bd) {
645 e1000_validate_option(&an, &opt, adapter); 645 an = AutoNeg[bd];
646 e1000_validate_option(&an, &opt, adapter);
647 } else {
648 an = opt.def;
649 }
646 adapter->hw.autoneg_advertised = an; 650 adapter->hw.autoneg_advertised = an;
647 } 651 }
648 652