Breno Leitao f8d05679fb net: free_netdev: exit earlier if dummy
For dummy devices, exit earlier at free_netdev() instead of executing
the whole function. This is necessary, because dummy devices are
special, and shouldn't have the second part of the function executed.

Otherwise reg_state, which is NETREG_DUMMY, will be overwritten and
there will be no way to identify that this is a dummy device. Also, this
device do not need the final put_device(), since dummy devices are not
registered (through register_netdevice()), where the device reference is
increased (at netdev_register_kobject()/device_add()).

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-04-24 12:00:16 +01:00
..
2024-04-24 12:00:16 +01:00
2024-04-11 19:29:22 -07:00
2024-03-07 21:12:41 -08:00
2024-04-01 10:49:28 +01:00
2024-04-15 10:46:01 +01:00
2024-01-23 15:13:55 +01:00
2022-12-12 15:04:39 -08:00
2024-03-07 21:12:42 -08:00