Commit caa9b35f authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller
Browse files

bonding: use the correct function to check for netdev name collision



A new helper to detect if a net device name is in use was added. Use it
here as the return reference from __dev_get_by_name was discarded.

Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 75ea27d0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -811,7 +811,7 @@ int bond_create_sysfs(struct bond_net *bn)
	 */
	if (ret == -EEXIST) {
		/* Is someone being kinky and naming a device bonding_master? */
		if (__dev_get_by_name(bn->net,
		if (netdev_name_in_use(bn->net,
				       class_attr_bonding_masters.attr.name))
			pr_err("network device named %s already exists in sysfs\n",
			       class_attr_bonding_masters.attr.name);