Re: [PATCH] x86: make sure we really have an hpet mapping beforeusing it

From: Ingo Molnar
Date: Tue Dec 16 2008 - 15:48:50 EST



* Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:

> 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@xxxxxxxxxx>
> ---
> arch/x86/kernel/hpet.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> ===================================================================
> --- a/arch/x86/kernel/hpet.c
> +++ b/arch/x86/kernel/hpet.c
> @@ -818,9 +818,10 @@
>
> hpet_address = force_hpet_address;
> hpet_enable();
> - if (!hpet_virt_address)
> - return -ENODEV;
> }
> +
> + if (!hpet_virt_address)
> + return -ENODEV;

hm, how can hpet_virt_address become non-NULL if hpet_address is zero?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/