|
@@ -2520,11 +2520,14 @@ static int set_phy_tunable(struct net_device *dev, void __user *useraddr)
|
|
static int ethtool_get_fecparam(struct net_device *dev, void __user *useraddr)
|
|
static int ethtool_get_fecparam(struct net_device *dev, void __user *useraddr)
|
|
{
|
|
{
|
|
struct ethtool_fecparam fecparam = { ETHTOOL_GFECPARAM };
|
|
struct ethtool_fecparam fecparam = { ETHTOOL_GFECPARAM };
|
|
|
|
+ int rc;
|
|
|
|
|
|
if (!dev->ethtool_ops->get_fecparam)
|
|
if (!dev->ethtool_ops->get_fecparam)
|
|
return -EOPNOTSUPP;
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
- dev->ethtool_ops->get_fecparam(dev, &fecparam);
|
|
|
|
|
|
+ rc = dev->ethtool_ops->get_fecparam(dev, &fecparam);
|
|
|
|
+ if (rc)
|
|
|
|
+ return rc;
|
|
|
|
|
|
if (copy_to_user(useraddr, &fecparam, sizeof(fecparam)))
|
|
if (copy_to_user(useraddr, &fecparam, sizeof(fecparam)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|