From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 29 Jun 2011 10:34:02 +0200 Subject: [U-Boot] [Patch] For bug in UBIFS function ubifs_finddir In-Reply-To: <4DFC750F.7050605@teamboyce.co.uk> References: <4DFC750F.7050605@teamboyce.co.uk> Message-ID: <201106291034.02844.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Rod, On Saturday 18 June 2011 11:51:11 Rod Boyce wrote: > 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 > ------------------------------- 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; This patch does not apply: 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? How did you create this patch? I recommend to use "git format-patch". And send it via "git send-email". Also, please change the patch subject and add "ubifs:": - For bug in UBIFS function ubifs_finddir + ubifs: Fix bug in function ubifs_finddir Please also take a look at this page for patch submission: http://www.denx.de/wiki/view/U-Boot/Patches Thanks. Cheers, Stefan -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de