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)
commit2014beea7eb165c745706b13659a0f1d0a9a2a61
tree90a705f85bf757ecf9926e6eb4f25ea7443f27a6
parent5ff96aec72190cab14a2edce8822e09497d6a70e
net: move net_set_todo inside rollback_registered()

Commit 93ee31f14f6f ("[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 cf124db566e6 ("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 c269a24ce057 ("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