kexec:Add some necessary fclose() calls
Subsystems (2)
PATCH 1/1 kexec:Add some necessary fclose() calls
fclose should be called before function exits
Signed-off-by Kai Song <[email protected]>
--- kexec/arch/ppc/fixup_dtb.c | 2 ++ kexec/arch/ppc64/crashdump-ppc64.c | 1 + kexec/arch/ppc64/kexec-ppc64.c | 4 +++- kexec/symbols.c | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-)
kexec/arch/ppc/fixup_dtb.c +2 -0
@@ -382,6 +382,8 @@ static void save_fixed_up_dtb(char *blob_buf, off_t blob_size) }else {dbgprintf ("Unable to write debug.dtb\n" ); } + +fclose (fp); }else {dbgprintf ("Unable to dump flat device tree to debug.dtb\n" ); }
kexec/arch/ppc64/crashdump-ppc64.c +1 -0
@@ -161,6 +161,7 @@ static int get_dyn_reconf_crash_memory_ranges(void)fprintf (stderr,"Error: Number of crash memory ranges" " excedeed the max limit\n" ); +fclose (file);return -1 ; }
kexec/arch/ppc64/kexec-ppc64.c +3 -1
@@ -200,8 +200,10 @@ static int get_dyn_reconf_base_ranges(void)fclose (file);return -1 ; } -if (nr_memory_ranges >= max_memory_ranges) +if (nr_memory_ranges >= max_memory_ranges) { +fclose (file);return -1 ; + }/* * If the property is ibm,dynamic-memory-v2, the first 4 bytes
kexec/symbols.c +2 -0
@@ -24,11 +24,13 @@ unsigned long long get_kernel_sym(const char *symbol)if (strcmp (sym, symbol) ==0 ) {dbgprintf ("kernel symbol %s vaddr = %16llx\n" , symbol, vaddr); +fclose (fp);return vaddr; } }dbgprintf ("Cannot get kernel %s symbol address\n" , symbol); +fclose (fp);return 0 ; }
Signature · 7 lines
2.27.0 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedQuoted 3 lines · Kai Song
fclose should be called before function exits
Signed-off-by Kai Song <[email protected]>
Thanks, applied.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec