diff options
Diffstat (limited to 'arch/powerpc/boot/gunzip_util.c')
-rw-r--r-- | arch/powerpc/boot/gunzip_util.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/powerpc/boot/gunzip_util.c b/arch/powerpc/boot/gunzip_util.c index df8ab07e9ff4..ef2aed0f63ca 100644 --- a/arch/powerpc/boot/gunzip_util.c +++ b/arch/powerpc/boot/gunzip_util.c | |||
@@ -78,6 +78,7 @@ void gunzip_start(struct gunzip_state *state, void *src, int srclen) | |||
78 | fatal("inflateInit2 returned %d\n\r", r); | 78 | fatal("inflateInit2 returned %d\n\r", r); |
79 | } | 79 | } |
80 | 80 | ||
81 | state->s.total_in = hdrlen; | ||
81 | state->s.next_in = src + hdrlen; | 82 | state->s.next_in = src + hdrlen; |
82 | state->s.avail_in = srclen - hdrlen; | 83 | state->s.avail_in = srclen - hdrlen; |
83 | } | 84 | } |
@@ -193,13 +194,10 @@ int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen) | |||
193 | { | 194 | { |
194 | int len; | 195 | int len; |
195 | 196 | ||
197 | len = gunzip_partial(state, dst, dstlen); | ||
198 | |||
196 | if (state->s.workspace) { | 199 | if (state->s.workspace) { |
197 | len = gunzip_partial(state, dst, dstlen); | ||
198 | zlib_inflateEnd(&state->s); | 200 | zlib_inflateEnd(&state->s); |
199 | } else { | ||
200 | /* uncompressed image */ | ||
201 | len = min(state->s.avail_in, (unsigned)dstlen); | ||
202 | memcpy(dst, state->s.next_in, len); | ||
203 | } | 201 | } |
204 | 202 | ||
205 | return len; | 203 | return len; |