diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2006-07-30 06:03:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-31 16:28:37 -0400 |
commit | 31925c8857ba17c11129b766a980ff7c87780301 (patch) | |
tree | a82ee8700076f19072780341c0aab35cee61b7eb | |
parent | 163ecdff060f2fa9e8f5238882fd0137493556a6 (diff) |
[PATCH] Fix ppc32 zImage inflate
The recent zlib update (commit 4f3865fb57a04db7cca068fed1c15badc064a302)
broke ppc32 zImage decompression as it tries to decompress to address zero
and the updated zlib_inflate checks that strm->next_out isn't a null
pointer.
This little patch fixes it.
[rpurdie@rpsys.net: add comment]
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | lib/zlib_inflate/inflate.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c index 7f922dccf1a5..fceb97c3aff7 100644 --- a/lib/zlib_inflate/inflate.c +++ b/lib/zlib_inflate/inflate.c | |||
@@ -347,7 +347,10 @@ int zlib_inflate(z_streamp strm, int flush) | |||
347 | static const unsigned short order[19] = /* permutation of code lengths */ | 347 | static const unsigned short order[19] = /* permutation of code lengths */ |
348 | {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; | 348 | {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; |
349 | 349 | ||
350 | if (strm == NULL || strm->state == NULL || strm->next_out == NULL || | 350 | /* Do not check for strm->next_out == NULL here as ppc zImage |
351 | inflates to strm->next_out = 0 */ | ||
352 | |||
353 | if (strm == NULL || strm->state == NULL || | ||
351 | (strm->next_in == NULL && strm->avail_in != 0)) | 354 | (strm->next_in == NULL && strm->avail_in != 0)) |
352 | return Z_STREAM_ERROR; | 355 | return Z_STREAM_ERROR; |
353 | 356 | ||