Skip to content

Commit

Permalink
autofs4: check for invalid dentry in getpath
Browse files Browse the repository at this point in the history
Catch invalid dentry when calculating its path.

Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ian Kent authored and Linus Torvalds committed May 1, 2008
1 parent afec570 commit cab0936
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/autofs4/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ static int autofs4_getpath(struct autofs_sb_info *sbi,
for (tmp = dentry ; tmp != root ; tmp = tmp->d_parent)
len += tmp->d_name.len + 1;

if (--len > NAME_MAX) {
if (!len || --len > NAME_MAX) {
spin_unlock(&dcache_lock);
return 0;
}
Expand Down

0 comments on commit cab0936

Please sign in to comment.