Skip to contentSkip to conversation

ksmbd: Use common code in ksmbd_vfs_set_init_posix_acl()

PATCH New Markus Elfring 1 participant 1 message Oct 4, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ksmbd: Use common code in ksmbd_vfs_set_init_posix_acl()

From: Markus Elfring <[email protected]>
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.

---
 fs/smb/server/vfs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fs/smb/server/vfs.c +4 -3
index 891ed2dc2b73..e53aa294b9ef 100644
@@ -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;
 }
 
Signature · 1 line
2.51.0