efilinux: Fix memory leaks in the error path

We leak a few chunks of memory if we take the error path in
efi_main(). Be sure to free the memory and clean up the file handles
in fs_exit().

Now that the caller of load_image() calls fs_exit() in the error path
we don't need to do it in the bzImage code (the kernel will reclaim
'fs_devices' anyway if it loads successfully), but we do need to be
sure to close any open file handles.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
4 files changed