[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86/hpet: fix cpumask allocation after 23990:1c8789852eaf



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1319475667 -3600
# Node ID 662dbf6ee71c3bd14db0d32cc69b85f8513527e3
# Parent  e458dfc35b8d3be04a9b72c30ff97163e27a7314
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@xxxxxxxx>
Tested-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Acked-by: Christoph Egger <Christoph.Egger@xxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
---


diff -r e458dfc35b8d -r 662dbf6ee71c xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Mon Oct 24 18:00:20 2011 +0100
+++ b/xen/arch/x86/hpet.c       Mon Oct 24 18:01:07 2011 +0100
@@ -512,15 +512,8 @@
             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;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.