Skip to content

Commit c75d1d5

Browse files
congwangdavem330
authored andcommitted
bonding: check return value of register_netdevice() in bond_newlink()
Very similar to commit 544f287 ("bonding: check error value of register_netdevice() immediately"), we should immediately check the return value of register_netdevice() before doing anything else. Fixes: 005db31 ("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]>
1 parent 76be93f commit c75d1d5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/bonding/bond_netlink.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,10 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev,
456456
return err;
457457

458458
err = register_netdevice(bond_dev);
459-
460-
netif_carrier_off(bond_dev);
461459
if (!err) {
462460
struct bonding *bond = netdev_priv(bond_dev);
463461

462+
netif_carrier_off(bond_dev);
464463
bond_work_init_all(bond);
465464
}
466465

0 commit comments

Comments
 (0)