net: add dev->dev_registered_tracker
authorEric Dumazet <edumazet@google.com>
Mon, 7 Feb 2022 18:41:07 +0000 (10:41 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Feb 2022 04:23:20 +0000 (20:23 -0800)
commitb2309a71c1f2fc841feb184195b2e46b2e139bf4
tree1b4e35003f3dfba1d8ff091a88411c0c462634f6
parent99f5a5f2b94840032e85f7616ef13301a962b96a
net: add dev->dev_registered_tracker

Convert one dev_hold()/dev_put() pair in register_netdevice()
and unregister_netdevice_many() to dev_hold_track()
and dev_put_track().

This would allow to detect a rogue dev_put() a bit earlier.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220207184107.1401096-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netdevice.h
net/core/dev.c