CIFS: Return directly after a failed build_path_from_dentry() in cifs_do_create()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 20 Aug 2017 15:17:30 +0000 (17:17 +0200)
committerSteve French <stfrench@microsoft.com>
Mon, 25 Nov 2019 07:14:53 +0000 (01:14 -0600)
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>
fs/cifs/dir.c

index 7ce689d..f3b7901 100644 (file)
@@ -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 &