From 4ed5978bdd99114db7773cb3d78f2998bd17f694 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Wed, 3 Oct 2012 18:08:52 +0100 Subject: [PATCH] xen/xen_initial_domain: check that xen_start_info is initialized Since commit commit 4c071ee5268f7234c3d084b6093bebccc28cdcba ("arm: initial Xen support") PV on HVM guests can be xen_initial_domain. However PV on HVM guests might have an unitialized xen_start_info, so check before accessing its fields. Signed-off-by: Stefano Stabellini Acked-by: Ian Campbell Reported-by: Konrad Rzeszutek Wilk Signed-off-by: Konrad Rzeszutek Wilk --- include/xen/xen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xen/xen.h b/include/xen/xen.h index 2c0d3a56c749..a74d4362c4f8 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -24,7 +24,7 @@ extern enum xen_domain_type xen_domain_type; #include #define xen_initial_domain() (xen_domain() && \ - xen_start_info->flags & SIF_INITDOMAIN) + xen_start_info && xen_start_info->flags & SIF_INITDOMAIN) #else /* !CONFIG_XEN_DOM0 */ #define xen_initial_domain() (0) #endif /* CONFIG_XEN_DOM0 */ -- 2.30.2