diff options
author | Martin Vystrčil <martin.vystrcil@m-linux.cz> | 2019-08-20 23:18:30 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-08-26 18:46:21 +0300 |
commit | d7af2a863017be1f5fd1b65a858ddc7e87d7b876 (patch) | |
tree | bc3c91231ca30e27927cc3f2f31278ab9e98fe01 | |
parent | bd98e6ae7160d5a4fc013266183506068227dd79 (diff) | |
download | u-boot-d7af2a863017be1f5fd1b65a858ddc7e87d7b876.tar.xz |
fat: FAT filesystem premature release of info struct.
File was found on specified location. Info about file was read,
but then immediately destroyed using 'free' call. As a result
file size was set to 0, hence fat process didn't read any data.
Premature 'free' call removed. Resources are freed right before
function return. File is read correctly.
Signed-off-by: Martin Vystrcil <martin.vystrcil@m-linux.cz>
-rw-r--r-- | fs/fat/fat.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 06c8ed14bd..29cae8d391 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -1174,10 +1174,6 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer, /* For saving default max clustersize memory allocated to malloc pool */ dir_entry *dentptr = itr->dent; - free(itr); - - itr = NULL; - ret = get_contents(&fsdata, dentptr, pos, buffer, maxsize, actread); out_free_both: |