Skip to content

Commit b096d62

Browse files
emuslnkuba-moo
authored andcommitted
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: 4d03e00 ("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>
1 parent 746e6ae commit b096d62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/pensando/ionic/ionic_ethtool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,8 @@ static int ionic_get_module_eeprom(struct net_device *netdev,
961961
len = min_t(u32, sizeof(xcvr->sprom), ee->len);
962962

963963
do {
964-
memcpy(data, xcvr->sprom, len);
965-
memcpy(tbuf, xcvr->sprom, len);
964+
memcpy(data, &xcvr->sprom[ee->offset], len);
965+
memcpy(tbuf, &xcvr->sprom[ee->offset], len);
966966

967967
/* Let's make sure we got a consistent copy */
968968
if (!memcmp(data, tbuf, len))

0 commit comments

Comments
 (0)