diff options
author | Pan Bian <bianpan2016@163.com> | 2017-08-08 21:42:47 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-08-17 16:53:33 +0800 |
commit | ef4064bb3f6a1037cbda8d025f564aab5bd2de35 (patch) | |
tree | 5a78aee0fd343ea43a1a409c672806be8bcdb8d3 /drivers/crypto/ccp | |
parent | dea632cadd129d1901efde6b1167a6250b2157fb (diff) | |
download | linux-ef4064bb3f6a1037cbda8d025f564aab5bd2de35.tar.bz2 |
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 <bianpan2016@163.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp')
-rw-r--r-- | drivers/crypto/ccp/ccp-ops.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |