Re: linux-next: parsing mem=700M broken

Ingo Oeser
2008-12-24T12:30:29Z

Hello Rusty,

On Wednesday 24 December 2008, Rusty Russell wrote:
> void __init finish_e820_parsing(void)
> {
> + bool userdef;

maybe init with userdef = false;

> + int i;
> +
> + if (memlimit) {
> + e820_remove_range(memlimit, ULLONG_MAX - memlimit, E820_RAM, 1);
> + userdef = true;
> + }
> +
> + if (exactmap) {
> +#ifdef CONFIG_CRASH_DUMP
> + /*
> + * If we are doing a crash dump, we still need to know
> + * the real mem size before original memory map is
> + * reset.
> + */
> + saved_max_pfn = e820_end_of_ram_pfn();
> +#endif
> + e820.nr_map = 0;
> + userdef = true;
> + }
> +
> + for (i = 0; i < user_e820.nr_map; i++) {
> + e820_add_region(user_e820.map[i].addr, user_e820.map[i].size,
> + user_e820.map[i].type);
> + userdef = true;
> + }
> +
> if (userdef) {
> int nr = e820.nr_map;

Because here it might be used uninitialized.

Best Regards

Ingo Oeser