ethtool: Fix get module eeprom fallback
authorIvan Vecera <ivecera@redhat.com>
Thu, 16 Jun 2022 16:08:55 +0000 (18:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jun 2022 07:03:23 +0000 (09:03 +0200)
commitefb10d2a047d115ec953187e1ccfd30b002473a2
treedccc92c21ed7c3da461d7ce11bd32992bae1fd91
parent6386fdde8df05e974e468d392c3684c790d75a4c
ethtool: Fix get module eeprom fallback

[ Upstream commit a3bb7b63813f674fb62bac321cdd897cc62de094 ]

Function fallback_set_params() checks if the module type returned
by a driver is ETH_MODULE_SFF_8079 and in this case it assumes
that buffer returns a concatenated content of page  A0h and A2h.
The check is wrong because the correct type is ETH_MODULE_SFF_8472.

Fixes: 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netlink command")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20220616160856.3623273-1-ivecera@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ethtool/eeprom.c