diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index ea2bc8b730..c97e9a9ce8 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -491,7 +491,7 @@ restart: repeat: next = this_parent->d_subdirs.next; resume: - while (next != &this_parent->d_subdirs) { + while (next && next != &this_parent->d_subdirs) { struct list_head *tmp = next; struct dentry *dchld = list_entry(tmp, struct dentry, d_child);