aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-12-16 15:32:23 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-16 16:01:46 -0500
commit39c04b55240342d0742ac48538d3d8c71bfc0a94 (patch)
tree13f5bb09b626fb60f7dd1b8d3b506617e585dd9b
parentbacbe9994541c70aa3abd1a013ac738e58d4bfb2 (diff)
x86: make sure we really have an hpet mapping before using it
Impact: prepare the hpet code for Xen dom0 booting When booting in Xen dom0, the hpet isn't really accessible, so make sure the mapping is non-NULL before use. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/hpet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 84089dc8fd1d..a1f6ed5e1a05 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -834,10 +834,11 @@ static __init int hpet_late_init(void)
834 834
835 hpet_address = force_hpet_address; 835 hpet_address = force_hpet_address;
836 hpet_enable(); 836 hpet_enable();
837 if (!hpet_virt_address)
838 return -ENODEV;
839 } 837 }
840 838
839 if (!hpet_virt_address)
840 return -ENODEV;
841
841 hpet_reserve_platform_timers(hpet_readl(HPET_ID)); 842 hpet_reserve_platform_timers(hpet_readl(HPET_ID));
842 843
843 for_each_online_cpu(cpu) { 844 for_each_online_cpu(cpu) {