Skip to content

Commit

Permalink
crypto: ccp - use dma_mapping_error to check map error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Gary R Hook <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
SinkFinder authored and herbertx committed Aug 17, 2017
1 parent dea632c commit ef4064b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/ccp/ccp-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ef4064b

Please sign in to comment.