octeontx2-pf: Fix otx2_get_fecparam()
commit38b5133ad6upstream. Static checkers complained about an off by one read overflow in otx2_get_fecparam() and we applied two conflicting fixes for it. Correct:b0aae0bde2("octeontx2: Fix condition.") Wrong:93efb0c656("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()") Revert the incorrect fix. Fixes:93efb0c656("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ddeef5079c
commit
af442dd3e3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user