client/web: fix lock/unlock order when updating s.self

Updates tailscale/corp#13775

Signed-off-by: Sonia Appasamy <[email protected]>
This commit is contained in:
Sonia Appasamy committed 2023-08-28 13:15:39 -04:00
1 parent c86a610eb3
commit 25924fbce2
1 file changed
+2 -2
+2 -2
View File
@@ -160,10 +160,10 @@ func (s *Server) watchSelf(ctx context.Context) {
// updateSelf grabs the lock and updates s.self.
// Then logs if anything changed.
func (s *Server) updateSelf(self tailcfg.NodeView) {
s.selfMu.Lock()
s.selfMu.Unlock()
prev := s.self
s.self = self
s.selfMu.Unlock()
s.selfMu.Lock()
var old, new tailcfg.StableNodeID
if prev.Valid() {