From: Ian Kent Date: Thu, 1 May 2008 11:35:07 +0000 (-0700) Subject: autofs4: check for invalid dentry in getpath X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cab0936aac8aa907c6bb814c2cf26385478f254b;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 1fe28e4754c..75e5955c3f6 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; }