HomeFreeBSD

arswitch: Ensure the lock is always held when calling arswitch_modifyreg()

Description

arswitch: Ensure the lock is always held when calling arswitch_modifyreg()

arswitch_setled() and a number of _global_setup functions did not acquire the
lock before calling arswitch_modifyreg(). With WITNESS enabled this would
instantly panic.

Discovered on a TPLink-3600:
("panic: mutex arswitch not owned at sys/dev/etherswitch/arswitch/arswitch_reg.c:236")

Reviewed by: adrian, kan
Differential Revision: https://reviews.freebsd.org/D9187

Details