The logic in get_node_by_name() currently does not return when it finds
a child with the name being search for. This would mean that a command
such as `drmgr -Q -c port -s "Port 1" -w 0 -d 3` would always return:
drmgr: Port 1 not owned by partition
Signed-off-by: Robert Jennings <rc...@li...>
---
src/drmgr/common_pci.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: b/src/drmgr/common_pci.c
===================================================================
--- a/src/drmgr/common_pci.c
+++ b/src/drmgr/common_pci.c
@@ -903,6 +903,7 @@ get_node_by_name(const char *drc_name, u
{
struct dr_node *node, *all_nodes;
struct dr_node *prev_node = NULL;
+ int child_found = 0;
all_nodes = get_dlpar_nodes(node_type);
if (all_nodes == NULL) {
@@ -920,9 +921,12 @@ get_node_by_name(const char *drc_name, u
for (child = node->children; child; child = child->next) {
if (strcmp(drc_name, child->drc_name) == 0)
- break;
+ child_found = 1;
}
+ if (child_found)
+ break;
+
prev_node = node;
}
|