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

Thorsten Blum thorsten.blum at linux.dev
Tue Mar 24 08:45:18 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 89d5c9c354d4..aec16ceebd94 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