From be8a54d367bfef7a5b354975f878441383ce9993 Mon Sep 17 00:00:00 2001 From: YueHaibing Date: Fri, 28 Dec 2018 06:10:33 +0000 Subject: [PATCH] crypto: ux500 - catch dma submission error Test cookie return by dmaengine_submit() and return error if any. Signed-off-by: YueHaibing Signed-off-by: Herbert Xu --- drivers/crypto/ux500/cryp/cryp_core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index a92a66b1ff46..db94f89d8d11 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c @@ -595,6 +595,12 @@ static int cryp_set_dma_transfer(struct cryp_ctx *ctx, } cookie = dmaengine_submit(desc); + if (dma_submit_error(cookie)) { + dev_dbg(ctx->device->dev, "[%s]: DMA submission failed\n", + __func__); + return cookie; + } + dma_async_issue_pending(channel); return 0; -- 2.20.1