Skip to content
Snippets Groups Projects
Commit 3267bc1b authored by Wolfgang Denk's avatar Wolfgang Denk Committed by Stefan Roese
Browse files

ubifs: Fix bad free() sequence in ubifs_finddir()


Free private_data member element before freeing file structure.
This was causing malloc to crash. Also remove unnecessary variable
assigments as file structure gets free'd as well.

Signed-off-by: default avatarRod Boyce <uboot@teamboyce.co.uk>
Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
parent fa82f871
No related branches found
No related tags found
No related merge requests found
......@@ -360,6 +360,8 @@ out:
return err;
}
if (file->private_data)
kfree(file->private_data);
if (file)
free(file);
if (dentry)
......@@ -367,10 +369,6 @@ out:
if (dir)
free(dir);
if (file->private_data)
kfree(file->private_data);
file->private_data = NULL;
file->f_pos = 2;
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment