public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: jeffrey.t.kirsher@intel.com
Subject: [Patch] Typo in drivers/net/e1000/e1000_hw.c
Date: Wed, 28 Jun 2006 21:47:23 +0200	[thread overview]
Message-ID: <1151524043.26393.4.camel@alice> (raw)

hi,

spotted by coverity (id #539), we should use the define
with which the array is defined. We use min_agc as index
for e1000_igp_2_cable_length_table[IGP02E1000_AGC_LENGTH_TABLE_SIZE]
This patch also adds the -1 to make it safe so that we dont read
past the end of the array.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.17-git11/drivers/net/e1000/e1000_hw.c.orig	2006-06-28 21:46:55.000000000 +0200
+++ linux-2.6.17-git11/drivers/net/e1000/e1000_hw.c	2006-06-28 21:47:07.000000000 +0200
@@ -6012,7 +6012,7 @@ e1000_get_cable_length(struct e1000_hw *
 {
     int32_t ret_val;
     uint16_t agc_value = 0;
-    uint16_t cur_agc, min_agc = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
+    uint16_t cur_agc, min_agc = IGP02E1000_AGC_LENGTH_TABLE_SIZE - 1;
     uint16_t max_agc = 0;
     uint16_t i, phy_data;
     uint16_t cable_length;



             reply	other threads:[~2006-06-28 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-28 19:47 Eric Sesterhenn [this message]
2006-07-02  1:10 ` [Patch] Typo in drivers/net/e1000/e1000_hw.c Jeff Kirsher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1151524043.26393.4.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox