From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rod Boyce Date: Sat, 18 Jun 2011 10:51:11 +0100 Subject: [U-Boot] [Patch] For bug in UBIFS function ubifs_finddir In-Reply-To: References: Message-ID: <4DFC750F.7050605@teamboyce.co.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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; }