Re: [PATCH] efivarfs: Suppress false-positive kmemleak warning for sfi

From: Breno Leitao
Date: Wed Jul 16 2025 - 10:31:35 EST


On Wed, Jul 16, 2025 at 09:26:03AM -0400, James Bottomley wrote:
> On Wed, 2025-07-16 at 06:16 -0700, Breno Leitao wrote:

> > diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
> > index c900d98bf4945..07a3b9293396b 100644
> > --- a/fs/efivarfs/super.c
> > +++ b/fs/efivarfs/super.c
> > @@ -390,10 +390,22 @@ static int efivarfs_reconfigure(struct
> > fs_context *fc)
> >   return 0;
> >  }
> >  
> > +static void efivarfs_free(struct fs_context *fc)
> > +{
> > + struct efivarfs_fs_info *sfi;
> > +
> > + sfi = fc->s_fs_info;
> > + if (!sfi)
> > + return;
>
> Here, you'll excite the coccinelle checkers looking for if(x) free(x)
> because free() already also has a test for NULL.

Good point.

> Other than that elision, it looks fine to me.

Thanks. I will send a v2.
--breno