diff mbox series

[-next] crypto: ux500 catch dma submission error

Message ID 1545977433-125317-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [-next] crypto: ux500 catch dma submission error | expand

Commit Message

Yue Haibing Dec. 28, 2018, 6:10 a.m. UTC
Test cookie return by dmaengine_submit() and return error if any.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/crypto/ux500/cryp/cryp_core.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Herbert Xu Jan. 11, 2019, 6:31 a.m. UTC | #1
On Fri, Dec 28, 2018 at 06:10:33AM +0000, YueHaibing wrote:
> Test cookie return by dmaengine_submit() and return error if any.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/crypto/ux500/cryp/cryp_core.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c
index a92a66b..db94f89 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;