Commit:     02cc51149f99e3c6c106e1e16dcc2e016b1bc3b5
Parent:     1383a34fafeb9f49975fc33783960729fbd2cddf
Author:     Milton Miller <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 29 07:31:41 2007 -0600
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Apr 13 03:55:17 2007 +1000

    [POWERPC] bootwrapper: Decompress less, check more
    Our kernels put everything in the first load segment, and we read that.
    Instead of decompressing to the end of the gzip stream or supplied image
    and hoping we get it all, decompress the expected size and complain if
    it is not available.
    Signed-off-by: Milton Miller <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
 arch/powerpc/boot/main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 3039062..56b56a8 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -79,7 +79,10 @@ static struct addr_range prep_kernel(void)
               vmlinuz_addr, vmlinuz_addr+vmlinuz_size);
        /* discard up to the actual load data */
        gunzip_discard(&gzstate, ei.elfoffset - sizeof(elfheader));
-       len = gunzip_finish(&gzstate, addr, ei.memsize);
+       len = gunzip_finish(&gzstate, addr, ei.loadsize);
+       if (len != ei.loadsize)
+               fatal("ran out of data!  only got 0x%x of 0x%lx bytes.\n\r",
+                               len, ei.loadsize);
        printf("done 0x%x bytes\n\r", len);
        flush_cache(addr, ei.loadsize);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to