diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/ethtool.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index e9b4556751ff..0adb3bec5b5a 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -2466,7 +2466,9 @@ static int get_phy_tunable(struct net_device *dev, void __user *useraddr) data = kmalloc(tuna.len, GFP_USER); if (!data) return -ENOMEM; + mutex_lock(&phydev->lock); ret = phydev->drv->get_tunable(phydev, &tuna, data); + mutex_unlock(&phydev->lock); if (ret) goto out; useraddr += sizeof(tuna); @@ -2501,7 +2503,9 @@ static int set_phy_tunable(struct net_device *dev, void __user *useraddr) ret = -EFAULT; if (copy_from_user(data, useraddr, tuna.len)) goto out; + mutex_lock(&phydev->lock); ret = phydev->drv->set_tunable(phydev, &tuna, data); + mutex_unlock(&phydev->lock); out: kfree(data); |