[U-Boot] [Patch] For bug in UBIFS function ubifs_finddir

Detlev Zundel dzu at denx.de
Wed Jun 29 13:35:35 CEST 2011


Hi Rod,

> Free private_data member element before freeing file structure.  This
> was causing malloc to crash.  Also remove unnecessary variable
> assigments after file structure was free'd.
>
> Signed-off-by: Rod Boyce <uboot at teamboyce.co.uk>
> ------------------------------- fs/ubifs/ubifs.c 
> ------------------------------
> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
> index 5a5c739..61f70b2 100644
> --- a/fs/ubifs/ubifs.c
> +++ b/fs/ubifs/ubifs.c
> @@ -360,6 +360,8 @@
>           return err;
>       }
>
> +    if (file->private_data)
> +        kfree(file->private_data);
>       if (file)
>           free(file);
>       if (dentry)
> @@ -367,10 +369,6 @@
>       if (dir)
>           free(dir);
>
> -    if (file->private_data)
> -        kfree(file->private_data);
> -    file->private_data = NULL;
> -    file->f_pos = 2;
>       return 0;
>   }

Actually the patch looks good - though I cannot apply the patch easily:

[dzu at pollux u-boot-testing (master)]$ git am -3 ~/transfer/p1
Applying: For bug in UBIFS function ubifs_finddir
Using index info to reconstruct a base tree...
error: patch failed: fs/ubifs/ubifs.c:360
error: fs/ubifs/ubifs.c: patch does not apply
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.
Patch failed at 0001 For bug in UBIFS function ubifs_finddir
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

Can you please resend the patch in a way that makes it possible to apply
to current master?  And if you do that, please change the subject line
to something more expressive.

Thanks
  Detlev

-- 
... the tools we are trying to use and the language or notation we are using to
express or record our thoughts,  are the major factors  determining what we can
think or express at all!
                                        -- Edsger W. Dijkstra
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the U-Boot mailing list