]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
image: Update zstd to avoid reporting error twice
authorSimon Glass <sjg@chromium.org>
Sat, 25 Sep 2021 13:03:12 +0000 (07:03 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 8 Oct 2021 19:53:26 +0000 (15:53 -0400)
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>
common/image.c

index 1102483e0a31aeaaa07e05d3babfc1487165aa80..62314a9f59e134dff9e7b713fc980171baac82a0 100644 (file)
@@ -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 */