[Skiboot] [PATCH trivial 2/2] opal-prd: Fix memory leak in is-fsp-system check

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Tue Apr 9 21:51:25 AEST 2019


Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 external/opal-prd/opal-prd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 41d13ecf7..33ea5f5a8 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -255,6 +255,7 @@ static void pr_log_daemon_init(void)
 /* Check service processor type */
 static bool is_fsp_system(void)
 {
+	bool fsp_system = true;
 	char *path;
 	int rc;
 
@@ -264,7 +265,11 @@ static bool is_fsp_system(void)
 		return false;
 	}
 
-	return access(path, F_OK) ? false : true;
+	if (access(path, F_OK))
+		fsp_system = false;
+
+	free(path);
+	return fsp_system;
 }
 
 /**
-- 
2.14.3



More information about the Skiboot mailing list