Skip to content

Commit

Permalink
octeontx2-pf: Fix otx2_get_fecparam()
Browse files Browse the repository at this point in the history
Static checkers complained about an off by one read overflow in
otx2_get_fecparam() and we applied two conflicting fixes for it.

Correct: b0aae0b ("octeontx2: Fix condition.")
  Wrong: 93efb0c ("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()")

Revert the incorrect fix.

Fixes: 93efb0c ("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Feb 17, 2021
1 parent c776626 commit 38b5133
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 38b5133

Please sign in to comment.