summaryrefslogtreecommitdiff
path: root/kexec/crashdump.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2008-06-24 22:03:56 +0100
committerSimon Horman <horms@verge.net.au>2008-06-27 12:21:34 +1000
commitf3206ae630c71d3a0470a6f4c8b26681a8e0aefc (patch)
tree51304bfc953274bbe1abb2183c2a40f859707f81 /kexec/crashdump.c
parent7d982ee8d961c1fc03a914ae9508c997f2cfde9d (diff)
kexec/crashdump.c: remove file descriptor leaks; make kdump_info argument to get_vmcoreinfo() const
Add the missing fclose(). Constify a char pointer. Signed-off-by: WANG Cong <wangcong@zeuux.org> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/crashdump.c')
-rw-r--r--kexec/crashdump.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index e0ba36d..92de524 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -107,10 +107,11 @@ int get_crash_notes_per_cpu(int cpu, uint64_t *addr, uint64_t *len)
printf("crash_notes addr = %Lx\n", *addr);
#endif
+ fclose(fp);
return 0;
}
-static int get_vmcoreinfo(char *kdump_info, uint64_t *addr, uint64_t *len)
+static int get_vmcoreinfo(const char *kdump_info, uint64_t *addr, uint64_t *len)
{
char line[MAX_LINE];
int count;
@@ -132,6 +133,7 @@ static int get_vmcoreinfo(char *kdump_info, uint64_t *addr, uint64_t *len)
*addr = (uint64_t) temp;
*len = (uint64_t) temp2;
+ fclose(fp);
return 0;
}