diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-02-17 10:41:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-02-18 01:33:22 +0300 |
commit | 38b5133ad607ecdcc8d24906d1ac9cc8df41acd5 (patch) | |
tree | d96a1e85503a53efc5ed4c7116ea72c434019557 /drivers | |
parent | c77662605d8d715062f15bbf567b5a61082b4967 (diff) | |
download | linux-38b5133ad607ecdcc8d24906d1ac9cc8df41acd5.tar.xz |
octeontx2-pf: Fix otx2_get_fecparam()
Static checkers complained about an off by one read overflow in
otx2_get_fecparam() and we applied two conflicting fixes for it.
Correct: b0aae0bde26f ("octeontx2: Fix condition.")
Wrong: 93efb0c65683 ("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()")
Revert the incorrect fix.
Fixes: 93efb0c65683 ("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c index 5fe74036a611..f4962a97a075 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c @@ -968,7 +968,7 @@ static int otx2_get_fecparam(struct net_device *netdev, if (!rsp->fwdata.supported_fec) fecparam->fec = ETHTOOL_FEC_NONE; else - fecparam->fec = fec[rsp->fwdata.supported_fec - 1]; + fecparam->fec = fec[rsp->fwdata.supported_fec]; } return 0; } |