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