powerpc-utils/0006-drmgr-Free-nodes-returned-from-configure_connector.patch

47 lines
1.6 KiB
Diff

From 5db2df531f9c242b13ef6520814c99685144c6d4 Mon Sep 17 00:00:00 2001
From: Haren Myneni <haren@linux.ibm.com>
Date: Sat, 29 Jun 2024 14:14:10 -0700
Subject: [PATCH] drmgr: Free nodes returned from configure_connector
Upstream: merged, expected in v1.3.13
Git-commit: 5db2df531f9c242b13ef6520814c99685144c6d4
of_nodes returned from configure_connector should be freed after
updating the device tree and is missing in acquire_hp_resource()
and add_work(). This patch calls free_of_node() in these functions.
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
src/drmgr/common_pci.c | 1 +
src/drmgr/drslot_chrp_pci.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/drmgr/common_pci.c b/src/drmgr/common_pci.c
index 2411641..759589a 100644
--- a/src/drmgr/common_pci.c
+++ b/src/drmgr/common_pci.c
@@ -1434,6 +1434,7 @@ acquire_hp_resource(struct dr_connector *drc, char *of_path)
return -1;
rc = add_device_tree_nodes(of_path, new_nodes);
+ free_of_node(new_nodes);
if (rc) {
say(ERROR, "add nodes failed for 0x%x\n", drc->index);
return rc;
diff --git a/src/drmgr/drslot_chrp_pci.c b/src/drmgr/drslot_chrp_pci.c
index ac078db..ec3c77c 100644
--- a/src/drmgr/drslot_chrp_pci.c
+++ b/src/drmgr/drslot_chrp_pci.c
@@ -454,6 +454,7 @@ static int add_work(struct dr_node *node, bool partner_device)
say(DEBUG, "Adding %s to %s\n", new_nodes->name, node->ofdt_path);
rc = add_device_tree_nodes(node->ofdt_path, new_nodes);
+ free_of_node(new_nodes);
if (rc) {
say(DEBUG, "add_device_tree_nodes failed at %s\n",
node->ofdt_path);
--
2.45.2