]> git.ipfire.org Git - people/arne_f/kernel.git/commit
bonding: check return value of register_netdevice() in bond_newlink()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 22 Jul 2020 23:31:54 +0000 (16:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:48 +0000 (10:19 +0200)
commit971041895df95302d6c7bcc1a5281a09b8794803
tree8c80de868a03b2989ff4a31699240a981df4c7a8
parentd9630a2fa599c2413d75d456997a1fdf2733b242
bonding: check return value of register_netdevice() in bond_newlink()

[ Upstream commit c75d1d5248c0c97996051809ad0e9f154ba5d76e ]

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: syzbot+bbc3a11c4da63c1b74d6@syzkaller.appspotmail.com
Cc: Beniamino Galvani <bgalvani@redhat.com>
Cc: Taehee Yoo <ap420073@gmail.com>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/bonding/bond_netlink.c