From: Pan Bian Date: Tue, 8 Aug 2017 13:42:47 +0000 (+0800) Subject: crypto: ccp - use dma_mapping_error to check map error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef4064bb3f6a1037cbda8d025f564aab5bd2de35;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git crypto: ccp - use dma_mapping_error to check map error The return value of dma_map_single() should be checked by dma_mapping_error(). However, in function ccp_init_dm_workarea(), its return value is checked against NULL, which could result in failures. Signed-off-by: Pan Bian Acked-by: Gary R Hook Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c index 804924e48c89..406b95329b3d 100644 --- a/drivers/crypto/ccp/ccp-ops.c +++ b/drivers/crypto/ccp/ccp-ops.c @@ -168,7 +168,7 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa, wa->dma.address = dma_map_single(wa->dev, wa->address, len, dir); - if (!wa->dma.address) + if (dma_mapping_error(wa->dev, wa->dma.address)) return -ENOMEM; wa->dma.length = len;