Skip to contentSkip to conversation

fat: FAT filesystem premature release of info struct.

PATCH New Martin Vystrčil 2 participants 2 messages Aug 20, 2019 – Aug 27, 2019 VFAT/FAT/msdos filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
  fs/fat/fat.c | 5 -----
  1 file changed, 5 deletions(-)
fs/fat/fat.c +0 -0
index 06c8ed14..4a55219a 100644
@@ -1173,11 +1173,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:

Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 fat: FAT filesystem premature release of info struct.

Quoted 8 lines · Martin VystrÄ�il

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190826/d9ee16fb/attachment.sig>