]> git.baikalelectronics.ru Git - kernel.git/commit
net: sit: unregister_netdevice on newlink's error path
authorJakub Kicinski <kuba@kernel.org>
Thu, 14 Jan 2021 01:29:47 +0000 (17:29 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 Jan 2021 18:26:46 +0000 (10:26 -0800)
commit80daafb2b5800e1f919e21dced3af9fa6cafed97
tree9f6f1441fd7d9f964c6019f16fd80a292c8bd035
parent1fb6fbd2d86429e8d73f05eb744365816f7a7dff
net: sit: unregister_netdevice on newlink's error path

We need to unregister the netdevice if config failed.
.ndo_uninit takes care of most of the heavy lifting.

This was uncovered by recent commit 5a137c4f496a ("net: make
free_netdev() more lenient with unregistering devices").
Previously the partially-initialized device would be left
in the system.

Reported-and-tested-by: syzbot+2393580080a2da190f04@syzkaller.appspotmail.com
Fixes: 405ae25df073 ("sit: allow to configure 6rd tunnels via netlink")
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20210114012947.2515313-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/sit.c