xen/dt-overlay: fix silent success in dt_overlay_remove_node

dt_overlay_remove_node() silently returns 0 when the target node is not
found in the parent's sibling list.  The loop simply exits without
matching and falls through to "return 0", making the caller believe the
node was successfully removed.

Return -ENODEV after the loop when no match is found, and change the
found-path from break to an explicit return 0 so the two outcomes are
distinct.

Fixes: 7e5c4a8b86 ("xen/arm: Implement device tree node removal functionalities")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Michal Orzel committed 2026-04-29 07:37:58 +02:00
1 parent a7b7a50b33
commit 62f3b2a867
1 file changed
+2 -2
+2 -2
View File
@@ -125,11 +125,11 @@ static int dt_overlay_remove_node(struct dt_device_node *device_node)
else
np->allnext = np->allnext->allnext;
break;
return 0;
}
}
return 0;
return -ENODEV;
}
static int dt_overlay_add_node(struct dt_device_node *device_node,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.