summaryrefslogtreecommitdiff
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorAntoine Tenart <atenart@kernel.org>2021-10-07 19:16:51 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-08 19:02:34 +0300
commitcaa9b35fadff57e6ee7499f2fb26f8abd83a133b (patch)
treea9a8c82c4e2c3a9b70ab70e93bc78e5ec5985b31 /drivers/net/bonding
parent75ea27d0d62281c31ee259c872dfdeb072cf5e39 (diff)
downloadlinux-caa9b35fadff57e6ee7499f2fb26f8abd83a133b.tar.xz
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: Antoine Tenart <atenart@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index b9e9842fed94..c48b77167fab 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -811,8 +811,8 @@ 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,
- class_attr_bonding_masters.attr.name))
+ 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);
ret = 0;