diff mbox series

[v3,07/15] image: Update zstd to avoid reporting error twice

Message ID 20210801150024.v3.7.I2527b4977aee302656ecc6eb5bde18b13f913b78@changeid
State Superseded
Delegated to: Tom Rini
Headers show
Series image: A partial series for the image clean-up | expand

Commit Message

Simon Glass Aug. 1, 2021, 9 p.m. UTC
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>
---

(no changes since v1)

 common/image.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/common/image.c b/common/image.c
index 6c38211efce..bd71bf7ec29 100644
--- a/common/image.c
+++ b/common/image.c
@@ -532,12 +532,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 */