]> git.baikalelectronics.ru Git - kernel.git/commit
net: move net_set_todo inside rollback_registered()
authorJakub Kicinski <kuba@kernel.org>
Tue, 19 Jan 2021 20:25:18 +0000 (12:25 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 05:04:18 +0000 (21:04 -0800)
commiteafb6b313169c8ed81e63d46b807acbe6ae6981f
tree90a705f85bf757ecf9926e6eb4f25ea7443f27a6
parent9dfe456a3f93667508740bbc796f134016d89b68
net: move net_set_todo inside rollback_registered()

Commit 19dbffef8f48 ("[NET]: Fix free_netdev on register_netdev
failure.") moved net_set_todo() outside of rollback_registered()
so that rollback_registered() can be used in the failure path of
register_netdevice() but without risking a double free.

Since commit 7e09adf7d54b ("net: Fix inconsistent teardown and
release of private netdev state."), however, we have a better
way of handling that condition, since destructors don't call
free_netdev() directly.

After the change in commit 5a137c4f496a ("net: make free_netdev()
more lenient with unregistering devices") we can now move
net_set_todo() back.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c