Skip to content

Commit

Permalink
octeontx2: Fix condition.
Browse files Browse the repository at this point in the history
Fixes: 93efb0c ("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Feb 13, 2021
1 parent 4b47ad0 commit b0aae0b
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 @@ -964,7 +964,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 b0aae0b

Please sign in to comment.