Skip to content

Commit

Permalink
CIFS: Return directly after a failed build_path_from_dentry() in cifs…
Browse files Browse the repository at this point in the history
…_do_create()

Return directly after a call of the function "build_path_from_dentry"
failed at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Markus Elfring authored and Steve French committed Nov 25, 2019
1 parent 2b1116b commit 598b6c5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/cifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,8 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
*oplock = REQ_OPLOCK;

full_path = build_path_from_dentry(direntry);
if (full_path == NULL) {
rc = -ENOMEM;
goto out;
}
if (!full_path)
return -ENOMEM;

if (tcon->unix_ext && cap_unix(tcon->ses) && !tcon->broken_posix_open &&
(CIFS_UNIX_POSIX_PATH_OPS_CAP &
Expand Down

0 comments on commit 598b6c5

Please sign in to comment.