tools: mkimage: fix sfspl_image_extract_subimage()

Do not leak file descriptor if writing fails.
Correct the error text if opening a file fails.

Addresses-Coverity-ID: 467054 Resource leaks
Fixes: 64fd30d367a1 ("tools: mkimage: Add StarFive SPL image support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
1 file changed