Re: [PATCH v3 1/2] mm/memfd: Refactor and cleanup the logic in memfd_create()
From: Isaac Manjarres
Date: Fri Jan 10 2025 - 11:42:09 EST
On Fri, Jan 10, 2025 at 10:12:13AM +0100, Alice Ryhl wrote:
> 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
Thanks! I'll go ahead and remove that and send out a new version.
--Isaac