We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20452a2 commit 2c49d9fCopy full SHA for 2c49d9f
pkg/sentry/kernel/fs_context.go
@@ -67,11 +67,13 @@ func (f *FSContext) destroy(ctx context.Context) {
67
// Hold f.mu so that we don't race with RootDirectory() and
68
// WorkingDirectory().
69
f.mu.Lock()
70
- defer f.mu.Unlock()
71
- f.root.DecRef(ctx)
+ root := f.root
+ cwd := f.cwd
72
f.root = vfs.VirtualDentry{}
73
- f.cwd.DecRef(ctx)
74
f.cwd = vfs.VirtualDentry{}
+ f.mu.Unlock()
75
+ root.DecRef(ctx)
76
+ cwd.DecRef(ctx)
77
}
78
79
// DecRef implements RefCounter.DecRef.
0 commit comments