Blob Blame History Raw
From 69431282f075ab723c4886f20aa248976920aaae Mon Sep 17 00:00:00 2001
From: Hari Bathini <hbathini@linux.vnet.ibm.com>
Date: Tue, 29 Aug 2017 23:08:02 +0530
Subject: [PATCH] kexec-tools: ppc64: fix leak while checking for coherent
 device memory

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
 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;
 		}
-- 
2.7.4