aboutsummaryrefslogtreecommitdiff
path: root/common/image.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-09-25 07:03:12 -0600
committerTom Rini <trini@konsulko.com>2021-10-08 15:53:26 -0400
commit02ace2cd4942da507414b23645cd7bec99f23174 (patch)
tree6ee474bcfb0fd27597feaa2034f28e7f3e509102 /common/image.c
parentb876eb87e91d6705ef946090af16175dfb5ce1f9 (diff)
downloadu-boot-02ace2cd4942da507414b23645cd7bec99f23174.zip
u-boot-02ace2cd4942da507414b23645cd7bec99f23174.tar.gz
u-boot-02ace2cd4942da507414b23645cd7bec99f23174.tar.bz2
image: Update zstd to avoid reporting error twice
The zstd implementation prints the error in image_decomp() which is incorrect and does not match other algorithms. Drop this and let the caller report the error. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/image.c')
-rw-r--r--common/image.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/common/image.c b/common/image.c
index 1102483..62314a9 100644
--- a/common/image.c
+++ b/common/image.c
@@ -534,12 +534,10 @@ int image_decomp(int comp, ulong load, ulong image_start, int type,
abuf_init_set(&in, image_buf, image_len);
abuf_init_set(&in, load_buf, unc_len);
ret = zstd_decompress(&in, &out);
- if (ret < 0) {
- printf("ZSTD decompression failed\n");
- return ret;
+ if (ret >= 0) {
+ image_len = ret;
+ ret = 0;
}
-
- image_len = ret;
break;
}
#endif /* CONFIG_ZSTD */