Panic occurs during loading driver using kldload. It exists since netlink is enabled.
There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx.
Bugzilla id: 271768
Part of panic:
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe010b8475d0
vpanic() at vpanic+0x150/frame 0xfffffe010b847620
panic() at panic+0x43/frame 0xfffffe010b847680
_sx_xlock_hard() at _sx_xlock_hard+0x82d/frame 0xfffffe010b847720
_sx_xlock() at _sx_xlock+0xb3/frame 0xfffffe010b847760
iflib_media_status() at iflib_media_status+0x32/frame 0xfffffe010b847790
ifmedia_ioctl() at ifmedia_ioctl+0x16a/frame 0xfffffe010b8477c0
dump_iface() at dump_iface+0x12f/frame 0xfffffe010b847840
rtnl_handle_ifevent() at rtnl_handle_ifevent+0xab/frame 0xfffffe010b8478c0
if_attach_internal() at if_attach_internal+0x41e/frame 0xfffffe010b847910
ether_ifattach() at ether_ifattach+0x29/frame 0xfffffe010b847940
iflib_device_register() at iflib_device_register+0xbf7/frame 0xfffffe010b8479d0
iflib_device_attach() at iflib_device_attach+0xb5/frame 0xfffffe010b847a00