|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1 of 4] KEXEC: Allocate crash notes on boot
>>> On 09.03.12 at 15:42, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> +static int __init kexec_init(void)
> +{
> + void *cpu = (void *)(unsigned long)smp_processor_id();
> +
> + /* If no crash area, no need to allocate space for notes. */
> + if ( !kexec_crash_area.size )
> + return 0;
> +
> + register_keyhandler('C', &crashdump_trigger_keyhandler);
Wouldn't this better be done only after successful crash_notes
allocation below?
> +
> + crash_notes = xmalloc_array(crash_note_range_t, nr_cpu_ids);
> + if ( ! crash_notes )
> + return -ENOMEM;
> +
> + memset(crash_notes, 0, sizeof(crash_note_range_t) * nr_cpu_ids);
Using xzalloc_array() above would be preferred.
> +
> + cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
> + register_cpu_notifier(&cpu_nfb);
> + return 0;
> +}
Looks okay otherwise, but I'm still not fully convinced all this is really
needed.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |