diff options
Diffstat (limited to 'fs/erofs/decompressor_zstd.c')
| -rw-r--r-- | fs/erofs/decompressor_zstd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/erofs/decompressor_zstd.c b/fs/erofs/decompressor_zstd.c index ae51faeb504d..beae49165c69 100644 --- a/fs/erofs/decompressor_zstd.c +++ b/fs/erofs/decompressor_zstd.c @@ -143,17 +143,17 @@ static const char *z_erofs_zstd_decompress(struct z_erofs_decompress_req *rq, zstd_in_buffer in_buf = { NULL, 0, 0 }; zstd_out_buffer out_buf = { NULL, 0, 0 }; struct z_erofs_zstd *strm; - const char *reason = NULL; zstd_dstream *stream; - int zerr, err; + const char *reason; + int zerr; /* 1. get the exact compressed size */ dctx.kin = kmap_local_page(*rq->in); - err = z_erofs_fixup_insize(rq, dctx.kin + rq->pageofs_in, + reason = z_erofs_fixup_insize(rq, dctx.kin + rq->pageofs_in, min(rq->inputsize, sb->s_blocksize - rq->pageofs_in)); - if (err) { + if (reason) { kunmap_local(dctx.kin); - return ERR_PTR(err); + return reason; } /* 2. get an available ZSTD context */ @@ -162,7 +162,7 @@ static const char *z_erofs_zstd_decompress(struct z_erofs_decompress_req *rq, /* 3. multi-call decompress */ stream = zstd_init_dstream(z_erofs_zstd_max_dictsize, strm->wksp, strm->wkspsz); if (!stream) { - err = -ENOMEM; + reason = ERR_PTR(-ENOMEM); goto failed_zinit; } @@ -208,7 +208,7 @@ failed_zinit: z_erofs_zstd_head = strm; spin_unlock(&z_erofs_zstd_lock); wake_up(&z_erofs_zstd_wq); - return reason ?: ERR_PTR(err); + return reason; } const struct z_erofs_decompressor z_erofs_zstd_decomp = { |
