fs/fat: fix fatbuf leak
authorRob Clark <robdclark@gmail.com>
Tue, 12 Sep 2017 20:40:01 +0000 (16:40 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 15 Sep 2017 13:03:15 +0000 (09:03 -0400)
commit725ffdb5cbcc4b8a9726a68cc6ae0713266ba5a9
tree4224ac06f68e5547a64d34fbbac9e581be101ab8
parent265edc03d5a19550d92cbd6e10631d5a15bdd1d5
fs/fat: fix fatbuf leak

A new fatbuf was allocated by get_fs_info() (called by fat_itr_root()),
but not freed, resulting in eventually running out of memory.  Spotted
by running 'ls -r' in a large FAT filesystem from Shell.efi.

fatbuf is mainly used to cache FAT entry lookups (get_fatent())..
possibly once fat_write.c it can move into the iterator to simplify
this.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ɓukasz Majewski <lukma@denx.de>
fs/fat/fat.c