net: transition netdev reg state earlier in run_todo
authorJakub Kicinski <kuba@kernel.org>
Tue, 15 Feb 2022 22:53:09 +0000 (14:53 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Feb 2022 16:22:17 +0000 (08:22 -0800)
commitae68db14b6164ce46beffaf35eb7c9bb2f92fee3
tree0fb1957384bf88225e30e269f29a57e621580d07
parent4d449bdc5b2678fd3afbf9b0c444ce38f34ac6f0
net: transition netdev reg state earlier in run_todo

In prep for unregistering netdevs out of order move the netdev
state validation and change outside of the loop.

While at it modernize this code and use WARN() instead of
pr_err() + dump_stack().

Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/20220215225310.3679266-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c