Linux-CIFS Archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-cifs@vger.kernel.org, Hyunchul Lee <hyc.lee@gmail.com>,
	Namjae Jeon <linkinjeon@kernel.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steve French <smfrench@gmail.com>, Tom Talpey <tom@talpey.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Stefan Metzmacher <metze@samba.org>
Subject: [PATCH] ksmbd: Use common code in ksmbd_vfs_set_init_posix_acl()
Date: Sat, 4 Oct 2025 20:52:54 +0200	[thread overview]
Message-ID: <d9952e5b-9b7d-417b-80e4-74bc6f769eb8@web.de> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 4 Oct 2025 20:45:22 +0200

Use an additional label so that another bit of common code can be better
reused at the end of this function implementation.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 fs/smb/server/vfs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index 891ed2dc2b73..e53aa294b9ef 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -1897,8 +1897,8 @@ int ksmbd_vfs_set_init_posix_acl(struct mnt_idmap *idmap,
 
 	acls = posix_acl_alloc(6, KSMBD_DEFAULT_GFP);
 	if (!acls) {
-		free_acl_state(&acl_state);
-		return -ENOMEM;
+		rc = -ENOMEM;
+		goto free_acl_state;
 	}
 	posix_state_to_acl(&acl_state, acls->a_entries);
 
@@ -1914,8 +1914,9 @@ int ksmbd_vfs_set_init_posix_acl(struct mnt_idmap *idmap,
 				    rc);
 	}
 
-	free_acl_state(&acl_state);
 	posix_acl_release(acls);
+free_acl_state:
+	free_acl_state(&acl_state);
 	return rc;
 }
 
-- 
2.51.0


                 reply	other threads:[~2025-10-04 18:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9952e5b-9b7d-417b-80e4-74bc6f769eb8@web.de \
    --to=markus.elfring@web.de \
    --cc=hyc.lee@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=metze@samba.org \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).