Commit ef4064bb authored by Pan Bian's avatar Pan Bian Committed by Herbert Xu

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: default avatarPan Bian <bianpan2016@163.com>
Acked-by: default avatarGary R Hook <gary.hook@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent dea632ca
...@@ -168,7 +168,7 @@ static int ccp_init_dm_workarea(struct ccp_dm_workarea *wa, ...@@ -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, wa->dma.address = dma_map_single(wa->dev, wa->address, len,
dir); dir);
if (!wa->dma.address) if (dma_mapping_error(wa->dev, wa->dma.address))
return -ENOMEM; return -ENOMEM;
wa->dma.length = len; wa->dma.length = len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment