nfp: use the correct index for link speed table
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 15 Jan 2018 19:47:53 +0000 (11:47 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Jan 2018 19:55:07 +0000 (14:55 -0500)
sts variable is holding link speed as well as state.  We should
be using ls to index into ls_to_ethtool.

Fixes: 265aeb511bd5 ("nfp: add support for .get_link_ksettings()")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c

index 2801ecd09eab098e66ef28aa89fcd5c5f7e7430d..6c02b2d6ba06625e8f11833c1f3a23f07895766a 100644 (file)
@@ -333,7 +333,7 @@ nfp_net_get_link_ksettings(struct net_device *netdev,
            ls >= ARRAY_SIZE(ls_to_ethtool))
                return 0;
 
-       cmd->base.speed = ls_to_ethtool[sts];
+       cmd->base.speed = ls_to_ethtool[ls];
        cmd->base.duplex = DUPLEX_FULL;
 
        return 0;