From 25924fbce2d24bbf70639714f9253e5043f3c822 Mon Sep 17 00:00:00 2001 From: Sonia Appasamy Date: Mon, 28 Aug 2023 13:15:19 -0400 Subject: [PATCH] client/web: fix lock/unlock order when updating s.self Updates tailscale/corp#13775 Signed-off-by: Sonia Appasamy --- client/web/web.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/web/web.go b/client/web/web.go index f18e83deb..3b9f62011 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -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() {