diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/buflib.c | 2 | ||||
-rw-r--r-- | firmware/chunk_alloc.c | 4 | ||||
-rw-r--r-- | firmware/linuxboot.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/firmware/buflib.c b/firmware/buflib.c index 0f8836b3b7..cb35290c03 100644 --- a/firmware/buflib.c +++ b/firmware/buflib.c | |||
@@ -894,7 +894,7 @@ bool | |||
894 | buflib_shrink(struct buflib_context* ctx, int handle, void* new_start, size_t new_size) | 894 | buflib_shrink(struct buflib_context* ctx, int handle, void* new_start, size_t new_size) |
895 | { | 895 | { |
896 | char* oldstart = buflib_get_data(ctx, handle); | 896 | char* oldstart = buflib_get_data(ctx, handle); |
897 | char* newstart = new_start; | 897 | char* newstart = new_start != NULL ? new_start : oldstart; |
898 | char* newend = newstart + new_size; | 898 | char* newend = newstart + new_size; |
899 | 899 | ||
900 | /* newstart must be higher and new_size not "negative" */ | 900 | /* newstart must be higher and new_size not "negative" */ |
diff --git a/firmware/chunk_alloc.c b/firmware/chunk_alloc.c index 6b80a475ab..85ad5d3489 100644 --- a/firmware/chunk_alloc.c +++ b/firmware/chunk_alloc.c | |||
@@ -172,12 +172,10 @@ static void finalize(struct chunk_alloc_header *hdr, struct chunk *chunk_array) | |||
172 | int handle = chunk_array[idx].handle; | 172 | int handle = chunk_array[idx].handle; |
173 | struct buflib_context *ctx = hdr->context; | 173 | struct buflib_context *ctx = hdr->context; |
174 | 174 | ||
175 | void* chunk_start = buflib_get_data(ctx, handle); | ||
176 | |||
177 | hdr->chunk_bytes_total -= hdr->chunk_bytes_free; | 175 | hdr->chunk_bytes_total -= hdr->chunk_bytes_free; |
178 | hdr->chunk_bytes_free = 0; | 176 | hdr->chunk_bytes_free = 0; |
179 | 177 | ||
180 | buflib_shrink(ctx, handle, chunk_start, hdr->chunk_bytes_total); | 178 | buflib_shrink(ctx, handle, NULL, hdr->chunk_bytes_total); |
181 | 179 | ||
182 | logf("%s shrink hdr idx[%ld] offset[%ld]: new size: %ld", | 180 | logf("%s shrink hdr idx[%ld] offset[%ld]: new size: %ld", |
183 | __func__, idx, chunk_array[idx].max_start_offset, hdr->chunk_bytes_total); | 181 | __func__, idx, chunk_array[idx].max_start_offset, hdr->chunk_bytes_total); |
diff --git a/firmware/linuxboot.c b/firmware/linuxboot.c index 74d87fbd64..6803bb466b 100644 --- a/firmware/linuxboot.c +++ b/firmware/linuxboot.c | |||
@@ -217,7 +217,7 @@ int uimage_load(struct uimage_header* uh, size_t* out_size, | |||
217 | if(ret) | 217 | if(ret) |
218 | goto err; | 218 | goto err; |
219 | 219 | ||
220 | core_shrink(out_h, core_get_data(out_h), *out_size); | 220 | core_shrink(out_h, NULL, *out_size); |
221 | ret = 0; | 221 | ret = 0; |
222 | 222 | ||
223 | err: | 223 | err: |