Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715969

[PATCH 6/8] CIFS: Return directly after a failed build_path_from_dentry() in cifs_do_create()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 6/8] CIFS: Return directly after a failed build_path_from_dentry() in cifs_do_create()
Date 2017-08-20 18:50 +0200
Message-ID <ugBAf-Z0-29@gated-at.bofh.it> (permalink)
References <ugBqx-Uw-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 20 Aug 2017 17:17:30 +0200

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>
---
 fs/cifs/dir.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 2c9cbd8393d6..248aead1f3f4 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -239,10 +239,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 &
-- 
2.14.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] CIFS: Adjustments for several function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-20 18:40 +0200
  [PATCH 3/8] CIFS: One function call less in cifs_lookup() after error  detection SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-20 18:40 +0200
  [PATCH 4/8] CIFS: Use common error handling code in cifs_mknod() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-20 18:40 +0200
  [PATCH 2/8] CIFS: Improve 27 size determinations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-20 18:40 +0200
  [PATCH 8/8] CIFS: One function call less in cifs_do_create() after  error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-20 18:50 +0200
  [PATCH 7/8] CIFS: Delete an unnecessary variable initialisation in  cifs_do_create() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-20 18:50 +0200
  [PATCH 6/8] CIFS: Return directly after a failed  build_path_from_dentry() in cifs_do_create() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-20 18:50 +0200

csiph-web