summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/kernfs/fstree.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-06 02:14:41 +0000
committergVisor bot <gvisor-bot@google.com>2020-06-06 02:14:41 +0000
commit3fd0d124a05da2850ba2f1fb2e367d16266a5bf5 (patch)
tree589002f811ebaa5f51cf47b181099a975a6805cf /pkg/sentry/fsimpl/kernfs/fstree.go
parentc346064ffa0852a1a6a0c19a25bd5a5d30e1376f (diff)
parent21b6bc7280f68f43360a008ffd02a4f461ec9fc8 (diff)
Merge release-20200522.0-89-g21b6bc72 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/kernfs/fstree.go')
-rw-r--r--pkg/sentry/fsimpl/kernfs/fstree.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/kernfs/fstree.go b/pkg/sentry/fsimpl/kernfs/fstree.go
index 4c4033462..ce86d7919 100644
--- a/pkg/sentry/fsimpl/kernfs/fstree.go
+++ b/pkg/sentry/fsimpl/kernfs/fstree.go
@@ -8,7 +8,7 @@ import (
// IsAncestorDentry returns true if d is an ancestor of d2; that is, d is
// either d2's parent or an ancestor of d2's parent.
func genericIsAncestorDentry(d, d2 *Dentry) bool {
- for {
+ for d2 != nil {
if d2.parent == d {
return true
}
@@ -17,6 +17,7 @@ func genericIsAncestorDentry(d, d2 *Dentry) bool {
}
d2 = d2.parent
}
+ return false
}
// ParentOrSelf returns d.parent. If d.parent is nil, ParentOrSelf returns d.