Patchwork [net-next-2.6] be2net: bug fix in be_read_eeprom

login
register
mail settings
Submitter Ajit Khaparde
Date Feb. 9, 2010, 3:51 a.m.
Message ID <20100209035115.GA6577@serverengines.com>
Download mbox | patch
Permalink /patch/44876/
State Accepted
Delegated to: David Miller
Headers show

Comments

Ajit Khaparde - Feb. 9, 2010, 3:51 a.m.
The offset to read the eeprom data was missing and
wrong eeprom data was being dumped. This patch fixes this.

From Suresh R <sureshr@serverengines.com>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
 drivers/net/benet/be_ethtool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
David Miller - Feb. 12, 2010, 8:28 p.m.
From: Ajit Khaparde <ajitkhaparde@gmail.com>
Date: Tue, 9 Feb 2010 09:21:26 +0530

> The offset to read the eeprom data was missing and
> wrong eeprom data was being dumped. This patch fixes this.
> 
>>From Suresh R <sureshr@serverengines.com>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 09d8899..dcc7f37 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -614,7 +614,7 @@  be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
 
 	if (!status) {
 		resp = (struct be_cmd_resp_seeprom_read *) eeprom_cmd.va;
-		memcpy(data, resp->seeprom_data, eeprom->len);
+		memcpy(data, resp->seeprom_data + eeprom->offset, eeprom->len);
 	}
 	pci_free_consistent(adapter->pdev, eeprom_cmd.size, eeprom_cmd.va,
 			eeprom_cmd.dma);