summaryrefslogtreecommitdiff
path: root/kexec/zlib.c
AgeCommit message (Collapse)Author
2020-11-30zlib: fix resource leak when gzdirect failedqiuguorui1
In function zlib_decompress_file, when gzdirect(fp) fails, we should gzclose fp before return. Fixes: d606837b56d46 ("Fix zlib/lzma decompression.") Signed-off-by: qiuguorui1 <qiuguorui1@huawei.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2019-07-16kexec/kexec-zlib.h: Add 'is_zlib_file()' helper functionBhupesh Sharma
This patch adds 'is_zlib_file()' helper function which can be used to quickly determine with the passed kernel image is a zlib compressed kernel image. This is specifically useful for arm64 zImage (or Image.gz) support, which is introduced by later patches in this patchset. Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2016-06-08kexec: fix warnings caused by selecting 64-bit file IO on 32-bit platformsRussell King
Fix warnings caused by selecting 64-bit file IO on 32-bit platforms. kexec/kexec.c:710:2: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'off_t' [-Wformat] kexec/zlib.c:63:4: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'off_t' [-Wformat] kexec/kexec-uImage.c:85:3: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'off_t' [-Wformat] Acked-by: Baoquan He <bhe@redhat.com> Signed-off-by: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Simon Horman <horms@verge.net.au>
2015-02-09Fix zlib/lzma decompression.Yousong Zhou
Let {zlib,lzma}_decompress_file() return NULL if anything wrong happened to allow the other method to have a chance to run. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Mark unused parametersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-11-30add support for loading lzma compressed kernelsFlorian Fainelli
This patch allows one to load a lzma compressed kernel using kexec -l. As I wanted the lzma code to be very similar to the existing zlib slurp_decompress I took lzread and associated routines from the cpio lzma support. Tested on my x86 laptop using the following commands: lzma e bzImage bzImage.lzma kexec -l bzImage.lzma Having lzma support is particularly useful on some embedded systems on which we have the kernel already lzma compressed and available on a mtd partition. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Simon Horman <horms@verge.net.au>