mirror of
https://github.com/torvalds/linux.git
synced 2025-11-04 18:49:34 +02:00
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>
This commit is contained in:
parent
55423e9c53
commit
f1e7a277a1
1 changed files with 3 additions and 0 deletions
|
|
@ -146,6 +146,9 @@ static char *automount_fullpath(struct dentry *dentry, void *page)
|
||||||
}
|
}
|
||||||
spin_unlock(&tcon->tc_lock);
|
spin_unlock(&tcon->tc_lock);
|
||||||
|
|
||||||
|
if (unlikely(!page))
|
||||||
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
s = dentry_path_raw(dentry, page, PATH_MAX);
|
s = dentry_path_raw(dentry, page, PATH_MAX);
|
||||||
if (IS_ERR(s))
|
if (IS_ERR(s))
|
||||||
return s;
|
return s;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue