mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
mm/memfd: clarify error handling labels in memfd_create()
err_name --> err_free_name (fd failure case) err_fd --> err_free_fd (file failure case) Link: https://lkml.kernel.org/r/20250610083730.527619-1-ye.liu@linux.dev Signed-off-by: Ye Liu <liuye@kylinos.cn> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user