From c7cd2c9eab6af6c676bcf286af37d729438fceae Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 12 Apr 2021 16:19:35 -0600 Subject: [PATCH] device: don't defer unlocking from loop Signed-off-by: Jason A. Donenfeld --- device/mobilequirks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/mobilequirks.go b/device/mobilequirks.go index a31ce3a..f27d9d7 100644 --- a/device/mobilequirks.go +++ b/device/mobilequirks.go @@ -9,8 +9,8 @@ func (device *Device) DisableSomeRoamingForBrokenMobileSemantics() { device.peers.RLock() for _, peer := range device.peers.keyMap { peer.Lock() - defer peer.Unlock() peer.disableRoaming = peer.endpoint != nil + peer.Unlock() } device.peers.RUnlock() }