diff options
author | Ivan Vecera <ivecera@redhat.com> | 2014-07-28 09:03:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-30 16:56:40 -0400 |
commit | dabf24d168ae7da5c3dc8c383db64b200e9ab483 (patch) | |
tree | cc106b6b4bf7b6cc5dca7534b2be08b587363a95 /drivers/net | |
parent | 26bcd8b72563b4c54892c4c2a409f6656fb8ae8b (diff) |
bna: fill the magic in bnad_get_eeprom() instead of validating
A driver should fill magic field of ethtool_eeprom struct in .get_eeprom
and validate it in .set_eeprom. The bna incorrectly validates it in both
and this makes its .get_eeprom interface unusable.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bnad_ethtool.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c index 882cad71ad62..d26adac6ab99 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c +++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c | |||
@@ -997,10 +997,8 @@ bnad_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, | |||
997 | unsigned long flags = 0; | 997 | unsigned long flags = 0; |
998 | int ret = 0; | 998 | int ret = 0; |
999 | 999 | ||
1000 | /* Check if the flash read request is valid */ | 1000 | /* Fill the magic value */ |
1001 | if (eeprom->magic != (bnad->pcidev->vendor | | 1001 | eeprom->magic = bnad->pcidev->vendor | (bnad->pcidev->device << 16); |
1002 | (bnad->pcidev->device << 16))) | ||
1003 | return -EFAULT; | ||
1004 | 1002 | ||
1005 | /* Query the flash partition based on the offset */ | 1003 | /* Query the flash partition based on the offset */ |
1006 | flash_part = bnad_get_flash_partition_by_offset(bnad, | 1004 | flash_part = bnad_get_flash_partition_by_offset(bnad, |