提交 98e8d95a 编写于 作者: W Wei Yongjun 提交者: Zheng Zengkai

crypto: qce - fix error return code in qce_skcipher_async_req_handle()

stable inclusion
from stable-5.10.50
commit e4a577d617914293ece95b74c51530327f53bd2a
bugzilla: 174522 https://gitee.com/openeuler/kernel/issues/I4DNFY

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e4a577d617914293ece95b74c51530327f53bd2a

--------------------------------

commit a8bc4f5e upstream.

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 1339a7c3 ("crypto: qce: skcipher: Fix incorrect sg count for dma transfers")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NThara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 782dc89b
...@@ -123,13 +123,17 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req) ...@@ -123,13 +123,17 @@ qce_skcipher_async_req_handle(struct crypto_async_request *async_req)
rctx->dst_sg = rctx->dst_tbl.sgl; rctx->dst_sg = rctx->dst_tbl.sgl;
dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst); dst_nents = dma_map_sg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst);
if (dst_nents < 0) if (dst_nents < 0) {
ret = dst_nents;
goto error_free; goto error_free;
}
if (diff_dst) { if (diff_dst) {
src_nents = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src); src_nents = dma_map_sg(qce->dev, req->src, rctx->src_nents, dir_src);
if (src_nents < 0) if (src_nents < 0) {
ret = src_nents;
goto error_unmap_dst; goto error_unmap_dst;
}
rctx->src_sg = req->src; rctx->src_sg = req->src;
} else { } else {
rctx->src_sg = rctx->dst_sg; rctx->src_sg = rctx->dst_sg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册