Re: [PATCH] secretmem: drop unneeded initialization in secretmem_file_create()

From: Lukas Bulwahn
Date: Tue Jul 05 2022 - 02:05:47 EST


On Mon, Jul 4, 2022 at 6:30 PM Mike Rapoport <rppt@xxxxxxxxxxxxx> wrote:
>
> Hi Lukas,
>
> On Mon, Jul 04, 2022 at 11:26:05AM +0200, Lukas Bulwahn wrote:
> > Drop the unneeded initialization of the local variable file in function
> > secretmem_file_create().
> >
> > No functional change and no change in the resulting object code.
> >
> > This unneeded initialization was already introduced with the introduction
> > of secretmem in commit 1507f51255c9 ("mm: introduce memfd_secret system
> > call to create "secret" memory areas"). This minor code-stylistic issue
> > was discovered as a dead store with clang-analyzer.
>
> You are right and in the current code the initialization is unneeded, but
> there's a pending patch that relies of this initialization:
>
> https://lore.kernel.org/all/Yr1jKwz2+SGxjcuW@xxxxxxxxxx/
>
> Let's wait and see how that fix develops.
>

Agree. I will continue tracking the evolution of this function and
resend my patch if this patch above does not land in the next six
months. For now, this clean-up patch here can be ignored.

Lukas