Skip to content

Commit e4a577d

Browse files
Wei Yongjungregkh
authored andcommitted
crypto: qce - fix error return code in qce_skcipher_async_req_handle()
commit a8bc4f5 upstream. Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 1339a7c ("crypto: qce: skcipher: Fix incorrect sg count for dma transfers") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fb0c0a0 commit e4a577d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/crypto/qce/skcipher.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,17 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req)
123123
rctx->dst_sg = rctx->dst_tbl.sgl;
124124

125125
dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
126-
if (dst_nents < 0)
126+
if (dst_nents < 0) {
127+
ret = dst_nents;
127128
goto error_free;
129+
}
128130

129131
if (diff_dst) {
130132
src_nents = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src);
131-
if (src_nents < 0)
133+
if (src_nents < 0) {
134+
ret = src_nents;
132135
goto error_unmap_dst;
136+
}
133137
rctx->src_sg = req->src;
134138
} else {
135139
rctx->src_sg = rctx->dst_sg;

0 commit comments

Comments
 (0)