[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/6] xen/dt-overlay: fix silent success in dt_overlay_remove_node


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 15 Apr 2026 13:36:58 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IKYP4E5I1ro3m4rC4xatOfhu9k8oT84Qye3Au8P0bR0=; b=a8GxZYSDyZkJoI361q3k74wq5Q2IR8W4iJ/UzrDJOtWXNfezZSLvApAsSvzq+E/0UjdLMwyf/BqWxeJYDexn277F0m1imBFEAVOOPIZ8FkSOp7jpLujnEFbsG1tl6GJOKvLdvSQyAmM0OOBnBOFnnCgKVMclZ9oEW6MDzE15zk8v30aQMFn8qbO4oSColCBxtgpu3XczY5BH4D2pVk4qI4y9VGU7BjtHiDb51hS6DV4dT9mqPbs2WVKPimLIw3Z9UqDiqiC5X/B+jFAt9dS2zlozHveXcAuqjehOcZpcXtbH+6HJz8/+Prj3BEXOd3ZXO/MewX62my30y+cukuDrQA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G7c2MUcoSltDJUc6qWC1367mtrZT8LhDV06G0jiBjnoBSUy28cYKmw4x8RnEJWXevbexQbRpcZwpamzZ0wcNQHxJeK988yh87V7BbG+jf9qTxoTETPn4dRV177rH3mndv22zs89mAtvzqy6waqAudTBjD380dl3bpzvSgWfsExH/6hk+yKMwWMQgF2yl5YZCq7cZoTeHwQGoMoXfbiNbesTOW8dZGnGEzVFRSYklrjvd0wuYw8swU/idUvblys+kyz6Ogj4Ch7WtjbNwMobRB1rSnNZqMTukgohb0aFdNGM0ite6fIV8OeH2FDuYAzj8538HiojMXoKrxy02sTFjjw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Wed, 15 Apr 2026 11:37:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal 
functionalities")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/common/device-tree/dt-overlay.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/dt-overlay.c 
b/xen/common/device-tree/dt-overlay.c
index 0eed1532a10d..d3d4669718ac 100644
--- a/xen/common/device-tree/dt-overlay.c
+++ b/xen/common/device-tree/dt-overlay.c
@@ -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,
-- 
2.43.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.