summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-17 01:33:04 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-17 01:33:04 +0000
commitf0a432001e2825731a19dd5dfcc9ad67ff161832 (patch)
treee2f012481b8e425411339d7713145bf574cfc2f2 /pkg/sentry/kernel
parenta30f38f72f1966a36eb138f2b5a5b5295012b58a (diff)
parentb55f0e5d40c17cadf68d6238564d675ed12f8f49 (diff)
Merge release-20200219.0-185-gb55f0e5 (automated)
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r--pkg/sentry/kernel/fd_table.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/fd_table.go b/pkg/sentry/kernel/fd_table.go
index 7de2e509e..dddc28d5a 100644
--- a/pkg/sentry/kernel/fd_table.go
+++ b/pkg/sentry/kernel/fd_table.go
@@ -536,7 +536,9 @@ func (f *FDTable) Remove(fd int32) (*fs.File, *vfs.FileDescription) {
case orig2 != nil:
orig2.IncRef()
}
- f.setAll(fd, nil, nil, FDFlags{}) // Zap entry.
+ if orig != nil || orig2 != nil {
+ f.setAll(fd, nil, nil, FDFlags{}) // Zap entry.
+ }
return orig, orig2
}