Skip to content

Commit

Permalink
octeontx2: Fix condition.
Browse files Browse the repository at this point in the history
commit b0aae0b upstream.

Fixes: 93efb0c ("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()")
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
davem330 authored and gregkh committed Dec 14, 2024
1 parent bde4e7c commit ddeef50
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 @@ -801,7 +801,7 @@ static int otx2_get_fecparam(struct net_device *netdev,
if (IS_ERR(rsp))
return PTR_ERR(rsp);

if (rsp->fwdata.supported_fec <= FEC_MAX_INDEX) {
if (rsp->fwdata.supported_fec < FEC_MAX_INDEX) {
if (!rsp->fwdata.supported_fec)
fecparam->fec = ETHTOOL_FEC_NONE;
else
Expand Down

0 comments on commit ddeef50

Please sign in to comment.