Browse Source

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>
Jeremy Fitzhardinge 16 years ago
parent
commit
39c04b5524
1 changed files with 3 additions and 2 deletions
  1. 3 2
      arch/x86/kernel/hpet.c

+ 3 - 2
arch/x86/kernel/hpet.c

@@ -834,10 +834,11 @@ static __init int hpet_late_init(void)
 
 
 		hpet_address = force_hpet_address;
 		hpet_address = force_hpet_address;
 		hpet_enable();
 		hpet_enable();
-		if (!hpet_virt_address)
-			return -ENODEV;
 	}
 	}
 
 
+	if (!hpet_virt_address)
+		return -ENODEV;
+
 	hpet_reserve_platform_timers(hpet_readl(HPET_ID));
 	hpet_reserve_platform_timers(hpet_readl(HPET_ID));
 
 
 	for_each_online_cpu(cpu) {
 	for_each_online_cpu(cpu) {