Skip to content

Commit f1e7a27

Browse files
Ruben DevosSteve French
authored andcommitted
smb: client: add NULL check in automount_fullpath
page is checked for null in __build_path_from_dentry_optional_prefix when tcon->origin_fullpath is not set. However, the check is missing when it is set. Add a check to prevent a potential NULL pointer dereference. Signed-off-by: Ruben Devos <devosruben6@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 55423e9 commit f1e7a27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/smb/client/namespace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ static char *automount_fullpath(struct dentry *dentry, void *page)
146146
}
147147
spin_unlock(&tcon->tc_lock);
148148

149+
if (unlikely(!page))
150+
return ERR_PTR(-ENOMEM);
151+
149152
s = dentry_path_raw(dentry, page, PATH_MAX);
150153
if (IS_ERR(s))
151154
return s;

0 commit comments

Comments
 (0)