summaryrefslogtreecommitdiffstats
path: root/net/core/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/ethtool.c')
-rw-r--r--net/core/ethtool.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index d2c47cdf25da..1320e8dce559 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -2038,11 +2038,17 @@ static noinline_for_stack int ethtool_flash_device(struct net_device *dev,
if (copy_from_user(&efl, useraddr, sizeof(efl)))
return -EFAULT;
+ efl.data[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0;
- if (!dev->ethtool_ops->flash_device)
- return -EOPNOTSUPP;
+ if (!dev->ethtool_ops->flash_device) {
+ int ret;
- efl.data[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0;
+ rtnl_unlock();
+ ret = devlink_compat_flash_update(dev, efl.data);
+ rtnl_lock();
+
+ return ret;
+ }
return dev->ethtool_ops->flash_device(dev, &efl);
}