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