lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <d9952e5b-9b7d-417b-80e4-74bc6f769eb8@web.de>
Date: Sat, 4 Oct 2025 20:52:54 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-cifs@...r.kernel.org, Hyunchul Lee <hyc.lee@...il.com>,
 Namjae Jeon <linkinjeon@...nel.org>,
 Sergey Senozhatsky <senozhatsky@...omium.org>,
 Steve French <smfrench@...il.com>, Tom Talpey <tom@...pey.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org,
 Stefan Metzmacher <metze@...ba.org>
Subject: [PATCH] ksmbd: Use common code in ksmbd_vfs_set_init_posix_acl()

From: Markus Elfring <elfring@...rs.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@...rs.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ