Re: [PATCH v3 1/2] mm/memfd: Refactor and cleanup the logic in memfd_create()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 9, 2025 at 7:59 PM Isaac J. Manjarres
<isaacmanjarres@xxxxxxxxxx> wrote:
>
> memfd_create() is a pretty busy function that could be easier to read
> if some of the logic was split out into helper functions.
>
> Therefore, split the flags sanitization, name allocation, and file
> structure allocation into their own helper functions.
>
> No functional change.
>
> Signed-off-by: Isaac J. Manjarres <isaacmanjarres@xxxxxxxxxx>

This looks reasonable to me. One nit below, but:

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

>         fd_install(fd, file);
> +       /* name is not needed beyond this point. */
>         kfree(name);
>         return fd;

This comment seems superfluous at this point, since kfree(name) is the
last statement of the function.

Alice





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux