mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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: Rod Boyce <uboot@teamboyce.co.uk> Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
fa82f871c8
commit
3267bc1b2b
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue