After testing, this problem does not happen every time, because the return value is a random value.
Please see the code below for details.
drivers/net/ethernet/freescale/sdk_dppa/dpaa_ethtool.c :
static int __cold dpa_get_ksettings(struct net_device *net_dev,
struct ethtool_link_ksettings *cmd)
{
int _errno;
struct dpa_priv_s *priv;
priv = netdev_priv(net_dev);
if (priv->mac_dev == NULL) {
netdev_info(net_dev, "This is a MAC-less interface\n");
return -ENODEV;
}
if (unlikely(priv->mac_dev->phy_dev == NULL)) {
netdev_dbg(net_dev, "phy device not initialized\n");
return 0;
}
phy_ethtool_ksettings_get(priv->mac_dev->phy_dev, cmd);
return _errno;
}
With the above sources, the variable _errno with no value is returned.
This is a random value depending on the status of the stack. Therefore, the command can not be executed correctly.After testing, this problem does not happen every time, because the return value is a random value.
Please see the code below for details.