提交 a6d50512 编写于 作者: E Edward Cree 提交者: David S. Miller

net: ethtool: don't ignore return from driver get_fecparam method

If ethtool_ops->get_fecparam returns an error, pass that error on to the
 user, rather than ignoring it.

Fixes: 1a5f3da2 ("net: ethtool: add support for forward error correction modes")
Signed-off-by: NEdward Cree <ecree@solarflare.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e2c0dc1f
......@@ -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)
{
struct ethtool_fecparam fecparam = { ETHTOOL_GFECPARAM };
int rc;
if (!dev->ethtool_ops->get_fecparam)
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)))
return -EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册