From: YueHaibing Date: Fri, 28 Dec 2018 06:10:33 +0000 (+0000) Subject: crypto: ux500 - catch dma submission error X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=be8a54d367bfef7a5b354975f878441383ce9993;p=linux.git 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 --- diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index a92a66b1ff46e..db94f89d8d113 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;