crypto: ux500 - catch dma submission error
authorYueHaibing <yuehaibing@huawei.com>
Fri, 28 Dec 2018 06:10:33 +0000 (06:10 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 11 Jan 2019 06:16:56 +0000 (14:16 +0800)
Test cookie return by dmaengine_submit() and return error if any.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ux500/cryp/cryp_core.c

index a92a66b1ff46ed689a71d02dc4ab41481284ed1c..db94f89d8d11300b30000b1993173a4708738883 100644 (file)
@@ -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;