aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hpet.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-10-24 18:01:07 +0100
committerJan Beulich <jbeulich@novell.com>2011-10-24 18:01:07 +0100
commit82017fad0d77cee9d4568146a63d97789fd6907e (patch)
tree90e7f89fa994e26a9962ab823d58b3097f6cb35b /xen/arch/x86/hpet.c
parenta16d59ea4b1b1463ac110e986a3c4e7c983a2544 (diff)
downloadxen-82017fad0d77cee9d4568146a63d97789fd6907e.tar.gz
xen-82017fad0d77cee9d4568146a63d97789fd6907e.tar.bz2
xen-82017fad0d77cee9d4568146a63d97789fd6907e.zip
x86/hpet: fix cpumask allocation after 23990:1c8789852eaf
hpet_fsb_cap_lookup(), if it doesn't find any FSB capable timer, leaves hpet_events allocated, while hpet_events->cpumask may not have been, As we're pretty generous with these one-time allocations already (in that hpet_events doesn't get freed when no usable counters were found, even if in that case only the first array entry [or none at all] may get used), simply make the cpumask allocation in the legacy case independent of whether hpet_events was NULL before. Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hpet.c')
-rw-r--r--xen/arch/x86/hpet.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 4c7f7dda4a..ece6654b33 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -512,15 +512,8 @@ void __init hpet_broadcast_init(void)
return;
if ( !hpet_events )
- {
hpet_events = xzalloc(struct hpet_event_channel);
- if ( hpet_events && !zalloc_cpumask_var(&hpet_events->cpumask) )
- {
- xfree(hpet_events);
- hpet_events = NULL;
- }
- }
- if ( !hpet_events )
+ if ( !hpet_events || !zalloc_cpumask_var(&hpet_events->cpumask) )
return;
hpet_events->irq = -1;