Some kernel headers have bogus 'initrd_addr_max' fields. This field
should never be zero. Set it to the old upper limit if unspecified.
Failure to set a non-zero value for the field results in a bogus
'memlimit' value, thereby unnecessarily reserving part of the memmap.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
if (!hdr.setup_sects)
hdr.setup_sects = 4;
- if (hdr.version < 0x0203)
+ if (hdr.version < 0x0203 || !hdr.initrd_addr_max)
hdr.initrd_addr_max = 0x37ffffff;
if (!memlimit && memlimit - 1 > hdr.initrd_addr_max)