[PATCH] kexec-tools: ppc64: fix leak while checking for coherent device memory

Hari Bathini hbathini at linux.vnet.ibm.com
Tue Aug 29 10:38:02 PDT 2017


Signed-off-by: Hari Bathini <hbathini at linux.vnet.ibm.com>
---

* Follow-up to http://lists.infradead.org/pipermail/kexec/2017-August/019436.html


 kexec/arch/ppc64/crashdump-ppc64.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
index 7ea3983..bc9f948 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -217,6 +217,7 @@ static int is_coherent_device_mem(const char *fname)
 			break;
 		}
 		if (!strncmp(buf, "ibm,coherent-device-memory", 26)) {
+			fclose(file);
 			ret = 1;
 			break;
 		}




More information about the kexec mailing list