xen/arm: Panic if we can't copy the DTB to dom0 memory
authorJulien Grall <julien.grall@linaro.org>
Wed, 4 Sep 2013 15:11:57 +0000 (16:11 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 9 Sep 2013 13:45:50 +0000 (14:45 +0100)
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/domain_build.c

index 9ca663a1468d035d85a21426c9b23985df168024..77e2a61e0c7a0f2a2a7bc41b17f17d261fb2cc0a 100644 (file)
@@ -535,11 +535,14 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
 static void dtb_load(struct kernel_info *kinfo)
 {
     void * __user dtb_virt = (void * __user)(register_t)kinfo->dtb_paddr;
+    unsigned long rc;
 
     printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n",
            kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt));
 
-    raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt));
+    rc = raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt));
+    if ( rc != 0 )
+        panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc);
     xfree(kinfo->fdt);
 }