linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mm/memfd: Clarify error handling labels in memfd_create()
@ 2025-06-10  8:37 Ye Liu
  0 siblings, 0 replies; only message in thread
From: Ye Liu @ 2025-06-10  8:37 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Ye Liu

From: Ye Liu <liuye@kylinos.cn>

err_name --> err_free_name (fd failure case)
err_fd --> err_free_fd (file failure case)

Signed-off-by: Ye Liu <liuye@kylinos.cn>

Changes in v2:
- Rename Subject.
- Use "err_free_name" and "err_free_fd".
- Link to v1:https://lore.kernel.org/all/20250609031858.73415-1-ye.liu@linux.dev/
---
 mm/memfd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/memfd.c b/mm/memfd.c
index ab367e61553d..4fc98abe6627 100644
--- a/mm/memfd.c
+++ b/mm/memfd.c
@@ -475,22 +475,22 @@ SYSCALL_DEFINE2(memfd_create,
 	fd = get_unused_fd_flags((flags & MFD_CLOEXEC) ? O_CLOEXEC : 0);
 	if (fd < 0) {
 		error = fd;
-		goto err_name;
+		goto err_free_name;
 	}
 
 	file = alloc_file(name, flags);
 	if (IS_ERR(file)) {
 		error = PTR_ERR(file);
-		goto err_fd;
+		goto err_free_fd;
 	}
 
 	fd_install(fd, file);
 	kfree(name);
 	return fd;
 
-err_fd:
+err_free_fd:
 	put_unused_fd(fd);
-err_name:
+err_free_name:
 	kfree(name);
 	return error;
 }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-06-10  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10  8:37 [PATCH v2] mm/memfd: Clarify error handling labels in memfd_create() Ye Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).