mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
a7b7a50b33
commit
62f3b2a867
1 file changed
+2
-2
@@ -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,
|
||||
|
||||