[PATCH RESEND 2/2] afs: replace goto with direct return in afs_lookup_atsys

Thorsten Blum thorsten.blum at linux.dev
Fri May 8 07:43:29 PDT 2026


Return ERR_PTR(-ENOMEM) directly and remove the obsolete out_p label.

Signed-off-by: Thorsten Blum <thorsten.blum at linux.dev>
---
 fs/afs/dir.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 24cea4d7eadf..c236c8b4af8f 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -919,10 +919,9 @@ static struct dentry *afs_lookup_atsys(struct inode *dir, struct dentry *dentry)
 
 	_enter("");
 
-	ret = ERR_PTR(-ENOMEM);
 	p = buf = kmalloc(AFSNAMEMAX, GFP_KERNEL);
 	if (!buf)
-		goto out_p;
+		return ERR_PTR(-ENOMEM);
 	if (dentry->d_name.len > 4) {
 		memcpy(p, dentry->d_name.name, dentry->d_name.len - 4);
 		p += dentry->d_name.len - 4;
@@ -954,7 +953,6 @@ static struct dentry *afs_lookup_atsys(struct inode *dir, struct dentry *dentry)
 out_s:
 	afs_put_sysnames(subs);
 	kfree(buf);
-out_p:
 	return ret;
 }
 



More information about the linux-afs mailing list