From: Anton Blanchard Date: Sat, 10 Apr 2010 18:05:21 +0000 (+0000) Subject: Remove MAX_HEADERS check X-Git-Tag: yaboot-1.3.17-rc1~20 X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=commitdiff_plain;h=ada23a5a94474a1bc0b6f72fb81aa5d2a5fa9e7f;hp=fbff125463559d88ce2e2c9cf09b97ede9c59b3d Remove MAX_HEADERS check The comparison against MAX_HEADERS doesn't match the error message and we are dynamically allocating memory for the program headers, so there should not be a limit. Signed-off-by: Anton Blanchard Signed-off-by: Tony Breeds --- diff --git a/second/yaboot.c b/second/yaboot.c index ac63c46..edb11c1 100644 --- a/second/yaboot.c +++ b/second/yaboot.c @@ -1013,8 +1013,6 @@ int get_params(struct boot_param_t* params) void yaboot_text_ui(void) { -#define MAX_HEADERS 32 - struct boot_file_t file; int result; static struct boot_param_t params; @@ -1211,11 +1209,6 @@ load_elf32(struct boot_file_t *file, loadinfo_t *loadinfo) loadinfo->entry = e->e_entry; - if (e->e_phnum > MAX_HEADERS) { - prom_printf ("Can only load kernels with one program header\n"); - goto bail; - } - ph = (Elf32_Phdr *)malloc(sizeof(Elf32_Phdr) * e->e_phnum); if (!ph) { prom_printf ("Malloc error\n"); @@ -1349,11 +1342,6 @@ load_elf64(struct boot_file_t *file, loadinfo_t *loadinfo) loadinfo->entry = e->e_entry; - if (e->e_phnum > MAX_HEADERS) { - prom_printf ("Can only load kernels with one program header\n"); - goto bail; - } - ph = (Elf64_Phdr *)malloc(sizeof(Elf64_Phdr) * e->e_phnum); if (!ph) { prom_printf ("Malloc error\n");