WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] x86/hpet: fix cpumask allocation after 23990:1c87898

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86/hpet: fix cpumask allocation after 23990:1c8789852eaf
From: "Jan Beulich" <JBeulich@xxxxxxxx>
Date: Fri, 21 Oct 2011 15:00:51 +0100
Cc: christoph.egger@xxxxxxx
Delivery-date: Fri, 21 Oct 2011 07:03:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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>

--- 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;
 


Attachment: x86-hpet-fix-23990.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>