[Skiboot] [PATCH 3/9] npu2-opencapi: Fix memory leak

Cyril Bur cyril.bur at au1.ibm.com
Mon Mar 19 15:54:14 AEDT 2018


Fixes: CID 264267
Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 hw/npu2-opencapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
index 135accab..e66ba6fb 100644
--- a/hw/npu2-opencapi.c
+++ b/hw/npu2-opencapi.c
@@ -1387,7 +1387,6 @@ static void npu2_opencapi_probe(struct dt_node *dn)
 	struct npu2 *n;
 	int rc, i = 0;
 
-	path = dt_get_path(dn);
 	gcid = dt_get_chip_id(dn);
 	index = dt_prop_get_u32(dn, "ibm,npu-index");
 	links = dt_prop_get_u32(dn, "ibm,npu-links");
@@ -1399,6 +1398,7 @@ static void npu2_opencapi_probe(struct dt_node *dn)
 		return;
 	}
 
+	path = dt_get_path(dn);
 	prlog(PR_INFO, "OCAPI: Chip %d Found OpenCAPI NPU%d (%d links) at %s\n",
 	      gcid, index, links, path);
 	free(path);
-- 
2.16.2



More information about the Skiboot mailing list