From: Markus Elfring Date: Sun, 20 Aug 2017 15:17:30 +0000 (+0200) Subject: CIFS: Return directly after a failed build_path_from_dentry() in cifs_do_create() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=598b6c57f2ff29df948c846f4bf3046c33d6b37f;p=linux.git CIFS: Return directly after a failed build_path_from_dentry() in cifs_do_create() Return directly after a call of the function "build_path_from_dentry" failed at the beginning. Signed-off-by: Markus Elfring Signed-off-by: Steve French --- diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 7ce689d31aa2d..f3b79012ff29c 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -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 &