[RFC PATCH] ubifs: Call ubifs_iput when ubifs_iget is used

Michael Nazzareno Trimarchi michael at amarulasolutions.com
Tue Aug 6 09:13:50 CEST 2024


Hi Heiko

On Tue, Aug 6, 2024 at 6:29 AM Heiko Schocher <hs at denx.de> wrote:
>
> Hello Michael,
>
> On 05.08.24 19:31, Michael Trimarchi wrote:
> > The inode should be freed after a reference is get to avoid
> > memory leak
> >
> > Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>
> > ---
> >   fs/ubifs/ubifs.c | 9 ++++++---
> >   1 file changed, 6 insertions(+), 3 deletions(-)
>
> As discussed, that patch looks valid to me!
>
> It would be good to have some testers...
>
> Looking through the code, I think there is one more place:
>
> $ git diff
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index d8d78a2d3d..a5d141055c 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -2322,6 +2322,7 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
>          }
>   #else
>          sb->s_root = NULL;
> +       ubifs_iput(inode);
>   #endif
>

Right, I think that people are reporting now those problem can try to
give a quick try on it

Michael

>          mutex_unlock(&c->umount_mutex);
> $
>
> What do you mean?
>
> bye,
> Heiko
> --
> DENX Software Engineering GmbH,      Managing Director: Erika Unter
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de



--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael at amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info at amarulasolutions.com
www.amarulasolutions.com


More information about the U-Boot mailing list