]> git.baikalelectronics.ru Git - kernel.git/commitdiff
octeontx2: Fix condition.
authorDavid S. Miller <davem@davemloft.net>
Sat, 13 Feb 2021 00:56:08 +0000 (16:56 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Feb 2021 00:56:08 +0000 (16:56 -0800)
Fixes: 93efb0c656837 ("octeontx2-pf: Fix out-of-bounds read in otx2_get_fecparam()")
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c

index f7e8ada32a26ee5002876507ba1d9fe6118be36d..5fe74036a6114764143400ba8f9195423b78be87 100644 (file)
@@ -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