aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@amd.com>2024-12-12 13:31:57 -0800
committerJakub Kicinski <kuba@kernel.org>2024-12-15 14:33:31 -0800
commitb096d62ba1323391b2db98b7704e2468cf3b1588 (patch)
tree638d1985bd055bf0b2e357ad160b5f02873de8b0
parentionic: no double destroy workqueue (diff)
downloadwireguard-linux-b096d62ba1323391b2db98b7704e2468cf3b1588.tar.xz
wireguard-linux-b096d62ba1323391b2db98b7704e2468cf3b1588.zip
ionic: use ee->offset when returning sprom data
Some calls into ionic_get_module_eeprom() don't use a single full buffer size, but instead multiple calls with an offset. Teach our driver to use the offset correctly so we can respond appropriately to the caller. Fixes: 4d03e00a2140 ("ionic: Add initial ethtool support") Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20241212213157.12212-4-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_ethtool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
index dda22fa4448c..9b7f78b6cdb1 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
@@ -961,8 +961,8 @@ static int ionic_get_module_eeprom(struct net_device *netdev,
len = min_t(u32, sizeof(xcvr->sprom), ee->len);
do {
- memcpy(data, xcvr->sprom, len);
- memcpy(tbuf, xcvr->sprom, len);
+ memcpy(data, &xcvr->sprom[ee->offset], len);
+ memcpy(tbuf, &xcvr->sprom[ee->offset], len);
/* Let's make sure we got a consistent copy */
if (!memcmp(data, tbuf, len))