]> Pileus Git - ~andy/linux/blobdiff - drivers/net/bonding/bond_sysfs.c
Merge branch 'driver-core-next' into Linux 3.2
[~andy/linux] / drivers / net / bonding / bond_sysfs.c
index 5a20804fdece8d1c281e310e49509973185a33ed..aef42f045320ae86eed4014835f90ccd786d1586 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/sched.h>
-#include <linux/sysdev.h>
 #include <linux/fs.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -319,6 +318,13 @@ static ssize_t bonding_store_mode(struct device *d,
                goto out;
        }
 
+       if (bond->slave_cnt > 0) {
+               pr_err("unable to update mode of %s because it has slaves.\n",
+                       bond->dev->name);
+               ret = -EPERM;
+               goto out;
+       }
+
        new_value = bond_parse_parm(buf, bond_mode_tbl);
        if (new_value < 0)  {
                pr_err("%s: Ignoring invalid mode value %.*s.\n",