summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2018-02-28 19:15:58 +0000
committerDavid S. Miller <davem@davemloft.net>2018-03-01 21:41:06 -0500
commita6d50512b4d86ecd9f5952525e454583be1c3b14 (patch)
treefb14a27b4bfd66d90ac7257474ba1e68e751b752 /net/core
parente2c0dc1f1d8e31eabed412b6f154ad549986bc28 (diff)
downloadlinux-a6d50512b4d86ecd9f5952525e454583be1c3b14.tar.gz
linux-a6d50512b4d86ecd9f5952525e454583be1c3b14.tar.bz2
linux-a6d50512b4d86ecd9f5952525e454583be1c3b14.zip
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: 1a5f3da20bd9 ("net: ethtool: add support for forward error correction modes") Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/ethtool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 494e6a5d7306..3f89c76d5c24 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -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;