]> git.dujemihanovic.xyz Git - u-boot.git/commit
mkimage: fit: Unmmap the memory before closing fd in fit_import_data()
authorLihua Zhao <lihua.zhao@windriver.com>
Sat, 18 Apr 2020 08:59:10 +0000 (01:59 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 24 Apr 2020 14:51:56 +0000 (10:51 -0400)
commit3fc85a782a3d46fcb32bfb93829d2424d696c4d3
treeee7edd630917ca017fd28223fe4013bfded6d228
parent3b32cf096bd6b1d8871ecaddb4250756242fb5f9
mkimage: fit: Unmmap the memory before closing fd in fit_import_data()

Without calling munmap(), the follow-up call to open() the same file
with a flag O_TRUNC seems not to cause any issue on Linux, but it fails
on Windows with error like below:

    Can't open kernel_fdt.itb.tmp: Permission denied

Fix this by unmapping the memory before closing fd in fit_import_data().

Signed-off-by: Lihua Zhao <lihua.zhao@windriver.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
tools/fit_image.c