diff options
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 0f539de640dc..ce4677668e2c 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -852,8 +852,11 @@ static ssize_t bonding_store_lacp(struct device *d, | |||
852 | struct device_attribute *attr, | 852 | struct device_attribute *attr, |
853 | const char *buf, size_t count) | 853 | const char *buf, size_t count) |
854 | { | 854 | { |
855 | int new_value, ret = count; | ||
856 | struct bonding *bond = to_bond(d); | 855 | struct bonding *bond = to_bond(d); |
856 | int new_value, ret = count; | ||
857 | |||
858 | if (!rtnl_trylock()) | ||
859 | return restart_syscall(); | ||
857 | 860 | ||
858 | if (bond->dev->flags & IFF_UP) { | 861 | if (bond->dev->flags & IFF_UP) { |
859 | pr_err("%s: Unable to update LACP rate because interface is up.\n", | 862 | pr_err("%s: Unable to update LACP rate because interface is up.\n", |
@@ -883,6 +886,8 @@ static ssize_t bonding_store_lacp(struct device *d, | |||
883 | ret = -EINVAL; | 886 | ret = -EINVAL; |
884 | } | 887 | } |
885 | out: | 888 | out: |
889 | rtnl_unlock(); | ||
890 | |||
886 | return ret; | 891 | return ret; |
887 | } | 892 | } |
888 | static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, | 893 | static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, |