Fix fd leakage in uki_image_probe()
Subsystems (2)
PATCH 1/1 Fix fd leakage in uki_image_probe()
There is a fd leakage in the fail path when writing to initrd fd in uki_image_probe(). Fix it by this patch.
Signed-off-by Pingfan Liu <[email protected]>
Cc Simon Horman <[email protected]>
--- kexec/kexec-uki.c | 1 + 1 file changed, 1 insertion(+)
kexec/kexec-uki.c +1 -0
@@ -77,6 +77,7 @@ int uki_image_probe(const char *file_buf, off_t buf_sz) sect_hdr->raw_data_size) != sect_hdr->raw_data_size) { dbgprintf("%s: Can't write the compressed file %s\n", __func__, initrd_fname); + close(initrd_fd); goto next; } else { implicit_initrd_fd =open (initrd_fname,O_RDONLY );
Signature · 7 lines
2.41.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedQuoted 6 lines · Pingfan Liu
There is a fd leakage in the fail path when writing to initrd fd in
uki_image_probe(). Fix it by this patch.Signed-off-by Pingfan Liu <[email protected]>Cc Simon Horman <[email protected]>
Thanks, applied.
...
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec