All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fat: FAT filesystem premature release of info struct.
@ 2019-08-20 20:18 Martin Vystrčil
  2019-08-27  0:18 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Vystrčil @ 2019-08-20 20:18 UTC (permalink / raw)
  To: u-boot

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>
---
  fs/fat/fat.c | 5 -----
  1 file changed, 5 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 06c8ed14..4a55219a 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -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:
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] fat: FAT filesystem premature release of info struct.
  2019-08-20 20:18 [U-Boot] [PATCH] fat: FAT filesystem premature release of info struct Martin Vystrčil
@ 2019-08-27  0:18 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-08-27  0:18 UTC (permalink / raw)
  To: u-boot

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 740 bytes --]

On Tue, Aug 20, 2019 at 10:18:30PM +0200, Martin Vystrčil wrote:

> 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>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-27  0:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 20:18 [U-Boot] [PATCH] fat: FAT filesystem premature release of info struct Martin Vystrčil
2019-08-27  0:18 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.