summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/memfs/named_pipe.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/fsimpl/memfs/named_pipe.go')
-rw-r--r--pkg/sentry/fsimpl/memfs/named_pipe.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/memfs/named_pipe.go b/pkg/sentry/fsimpl/memfs/named_pipe.go
index 732ed7c58..91cb4b1fc 100644
--- a/pkg/sentry/fsimpl/memfs/named_pipe.go
+++ b/pkg/sentry/fsimpl/memfs/named_pipe.go
@@ -54,6 +54,9 @@ func newNamedPipeFD(ctx context.Context, np *namedPipe, rp *vfs.ResolvingPath, v
if err != nil {
return nil, err
}
- fd.vfsfd.Init(&fd, rp.Mount(), vfsd)
+ mnt := rp.Mount()
+ mnt.IncRef()
+ vfsd.IncRef()
+ fd.vfsfd.Init(&fd, mnt, vfsd)
return &fd.vfsfd, nil
}