diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-01-06 07:45:44 +0100 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-09 16:54:48 +0100 |
commit | 32a4ec97461f00aa63747fc8978011ea771bd543 (patch) | |
tree | 0b9076b1374433d11e7ed89caf4e01703f87960a /drivers/net/e1000/e1000_param.c | |
parent | [PATCH] drivers/net/gianfar.h: "extern inline" -> "static inline" (diff) | |
download | linux-32a4ec97461f00aa63747fc8978011ea771bd543.tar.xz linux-32a4ec97461f00aa63747fc8978011ea771bd543.zip |
[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>
Diffstat (limited to 'drivers/net/e1000/e1000_param.c')
-rw-r--r-- | drivers/net/e1000/e1000_param.c | 10 |
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) static void __devinit e1000_check_copper_options(struct e1000_adapter *adapter) { - int speed, dplx; + int speed, dplx, an; int bd = adapter->bd_number; { /* Speed */ @@ -641,8 +641,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter) .p = an_list }} }; - int an = AutoNeg[bd]; - e1000_validate_option(&an, &opt, adapter); + if (num_AutoNeg > bd) { + an = AutoNeg[bd]; + e1000_validate_option(&an, &opt, adapter); + } else { + an = opt.def; + } adapter->hw.autoneg_advertised = an; } |