From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965372Ab2JCRJy (ORCPT ); Wed, 3 Oct 2012 13:09:54 -0400 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:23190 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964823Ab2JCRJx (ORCPT ); Wed, 3 Oct 2012 13:09:53 -0400 X-IronPort-AV: E=Sophos;i="4.80,528,1344211200"; d="scan'208";a="14921893" Date: Wed, 3 Oct 2012 18:08:52 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Ian Campbell CC: Stefano Stabellini , "xen-devel@lists.xensource.com" , "linux-kernel@vger.kernel.org" , Konrad Rzeszutek Wilk Subject: [PATCH] xen/xen_initial_domain: check that xen_start_info is initialized In-Reply-To: <1349282492.650.185.camel@zakaz.uk.xensource.com> Message-ID: References: <1349272182.650.150.camel@zakaz.uk.xensource.com> <1349272482.650.151.camel@zakaz.uk.xensource.com> <20121003141116.GA10633@phenom.dumpdata.com> <1349276431.650.156.camel@zakaz.uk.xensource.com> <1349279862.650.171.camel@zakaz.uk.xensource.com> <1349280814.650.178.camel@zakaz.uk.xensource.com> <1349282492.650.185.camel@zakaz.uk.xensource.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 diff --git a/include/xen/xen.h b/include/xen/xen.h index 9a39ca5..e7101bb 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -28,7 +28,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 */