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

Thorsten Blum thorsten.blum at linux.dev
Sat Jun 6 14:23:17 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 080664b67861..bc50f00c0c69 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -906,10 +906,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;
@@ -941,7 +940,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