From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH] x86/hpet: fix cpumask allocation after 23990:1c8789852eaf Date: Mon, 24 Oct 2011 12:39:12 +0200 Message-ID: <4EA54050.9020508@amd.com> References: <4EA19733020000780005CC83@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4EA19733020000780005CC83@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 10/21/11 16:00, Jan Beulich wrote: > 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 Tested-by: Christoph Egger Acked-by: Christoph Egger > > --- 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; > > > -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632