From: Ian Kent Date: Thu, 1 May 2008 11:35:07 +0000 (-0700) Subject: autofs4: check for invalid dentry in getpath X-Git-Tag: v2.6.26-rc1~55 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cab0936aac8aa907c6bb814c2cf26385478f254b;p=linux-2.6 autofs4: check for invalid dentry in getpath Catch invalid dentry when calculating its path. Signed-off-by: Ian Kent Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 1fe28e4754..75e5955c3f 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c @@ -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; }