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

[PATCH 2/4] xen/arm: Check return code from fdt_finish_reservemap()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 3 Mar 2025 09:56:48 +0100
  • 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=OufWKULnetNUAK9GTpERGyY8WgmttM8kb3z75tr7XYs=; b=tuCTZJpt2z4NZqj2j7Xv8ioAIww+4hLRMjtCjt2SxoPOfYpolyA66GyGkHRqW1smqv7e3PC+I+GgO6CZ5gwdDYSAlOW+jzrJJ1plf9j4E7/RndBLON+fMtX68bbCLU/jK+xR/S9UeiyY1Qc75dDZ+VRl3qgoe4sM608RNsErptye22YK0DAnXqw/frYcDbMWoL7xoVienumViR760ThPMkE/74KrVbuA9vMYlZAcmeXr82DVPGDp/ylCytcoyTGzgBWfX4E3qc4gsxqNWxIOo09l3GJD2lADYIrjUI+axYHQeVQ5mSqNUdm+W+H5I9tMRycTOQETw/SqvYR4REsgsw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VFcLwWoBsGkHznhuNS592/YvGst0L8lQYXGjQkf79yHfk/W77blGRcgZ6cZgGPOAdIroIXSnJTPGWOypNjIPnhGb8zfozj6szve/K/qXYoRCxc8+iOtjyBz6skRNai6O/4GYMRQouZmA8hiXu6TAiben+m9XpLG53SZidL0i8EOcDICmI2+FjCMyRxI/QZyGoeWZRcvSufxCesktUdeSI2VXDQ5gVE0UeBLJqUDa1oTg4IwnMRxRw2P2T3DEnhM+gmeQjPIJpO6UTe4TxLRqxWzJy7J7R16JHuU9+D7xo8rYRgd+sUEtReizJYFyDoBzzn/y1OPJGqYBi8AKdfiWCA==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 03 Mar 2025 08:57:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

fdt_finish_reservemap() may fail (with -FDT_ERR_NOSPACE) in which case
further DTB creation (in prepare_dtb_hwdom()) makes no sense. Fix it.

Fixes: 13bb63b754e4 ("device tree,arm: supply a flat device tree to dom0")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/domain_build.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 7b47abade196..fe05cf6d855f 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2033,7 +2033,9 @@ static int __init prepare_dtb_hwdom(struct domain *d, 
struct kernel_info *kinfo)
     if ( ret < 0 )
         goto err;
 
-    fdt_finish_reservemap(kinfo->fdt);
+    ret = fdt_finish_reservemap(kinfo->fdt);
+    if ( ret )
+        goto err;
 
     ret = handle_node(d, kinfo, dt_host, default_p2mt);
     if ( ret )
-- 
2.25.1




 


Rackspace

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