Blame SOURCES/kexec-tools-2.0.19-kexec-kexec.c-Add-the-missing-close-for-fd-used-for-.patch

603de6
From 019d8258f15c2a716786880c3cbd0f327a4dfc09 Mon Sep 17 00:00:00 2001
603de6
From: Bhupesh Sharma <bhsharma@redhat.com>
603de6
Date: Mon, 15 Jul 2019 11:32:53 +0530
603de6
Subject: [PATCH 1/5] kexec/kexec.c: Add the missing close() for fd used for
603de6
 kexec_file_load()
603de6
603de6
In kexec/kexec.c, we open() the kernel Image file and pass this file
603de6
descriptor to the kexec_file_load() system call, but never call a
603de6
corresponding close().
603de6
603de6
Fix the same via this patch.
603de6
603de6
Signed-off-by: Bhupesh Sharma <bhsharma@redhat.com>
603de6
Signed-off-by: Simon Horman <horms@verge.net.au>
603de6
---
603de6
 kexec/kexec.c | 2 ++
603de6
 1 file changed, 2 insertions(+)
603de6
603de6
diff --git a/kexec/kexec.c b/kexec/kexec.c
603de6
index 32ae56c8f1c3..8ca3b457cac8 100644
603de6
--- a/kexec/kexec.c
603de6
+++ b/kexec/kexec.c
603de6
@@ -1234,6 +1234,8 @@ static int do_kexec_file_load(int fileind, int argc, char **argv,
603de6
 	if (ret != 0)
603de6
 		fprintf(stderr, "kexec_file_load failed: %s\n",
603de6
 					strerror(errno));
603de6
+
603de6
+	close(kernel_fd);
603de6
 	return ret;
603de6
 }
603de6
 
603de6
-- 
603de6
2.7.4
603de6