diff options
author | Cong Wang <[email protected]> | 2020-07-22 16:31:54 -0700 |
---|---|---|
committer | David S. Miller <[email protected]> | 2020-07-23 15:17:04 -0700 |
commit | c75d1d5248c0c97996051809ad0e9f154ba5d76e (patch) | |
tree | 1cadd752d4d26374c14ee487680005698eb2b7e2 | |
parent | 76be93fc0702322179bb0ea87295d820ee46ad14 (diff) |
bonding: check return value of register_netdevice() in bond_newlink()
Very similar to commit 544f287b8495
("bonding: check error value of register_netdevice() immediately"),
we should immediately check the return value of register_netdevice()
before doing anything else.
Fixes: 005db31d5f5f ("bonding: set carrier off for devices created through netlink")
Reported-and-tested-by: [email protected]
Cc: Beniamino Galvani <[email protected]>
Cc: Taehee Yoo <[email protected]>
Cc: Jay Vosburgh <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | drivers/net/bonding/bond_netlink.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c index b43b51646b11..f0f9138e967f 100644 --- a/drivers/net/bonding/bond_netlink.c +++ b/drivers/net/bonding/bond_netlink.c @@ -456,11 +456,10 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev, return err; err = register_netdevice(bond_dev); - - netif_carrier_off(bond_dev); if (!err) { struct bonding *bond = netdev_priv(bond_dev); + netif_carrier_off(bond_dev); bond_work_init_all(bond); } |