Skip to content

Commit

Permalink
octeontx2-pf: Fix otx2_get_fecparam()
Browse files Browse the repository at this point in the history
commit 38b5133 upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dan Carpenter authored and gregkh committed Dec 14, 2024
1 parent ddeef50 commit af442dd
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 @@ -805,7 +805,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 af442dd

Please sign in to comment.