fs: fat: Fix possible double free of fatbuf
authorAndrew F. Davis <afd@ti.com>
Thu, 16 May 2019 14:34:31 +0000 (09:34 -0500)
committerTom Rini <trini@konsulko.com>
Tue, 28 May 2019 17:57:52 +0000 (13:57 -0400)
commitd0cd30eb8137c0f14034aeb22c9f00cd70ccc98c
tree578f8d0eb912a6adc8b64b92640c60853c384738
parent7b437807ee0a051f46d329e868e0295299026b75
fs: fat: Fix possible double free of fatbuf

fat_itr_root() allocates fatbuf so we free it on the exit path, if
the function fails we should not free it, check the return value
and skip freeing if the function fails.

Signed-off-by: Andrew F. Davis <afd@ti.com>
fs/fat/fat.c