diff options
author | Hadar Gat <hadar.gat@arm.com> | 2019-01-15 14:43:12 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-01-25 11:41:50 +0100 |
commit | 32be4c5b0fd2679b488619fe7dc8a15ef477a38a (patch) | |
tree | cff93c6ccc79f181a9047855ac94616e8d3f9cd4 /drivers/crypto/ccree | |
parent | crypto: ccree - improve error handling (diff) | |
download | linux-32be4c5b0fd2679b488619fe7dc8a15ef477a38a.tar.xz linux-32be4c5b0fd2679b488619fe7dc8a15ef477a38a.zip |
crypto: ccree - add error message
Add error message in case of too many mlli entries.
Signed-off-by: Hadar Gat <hadar.gat@arm.com>
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree')
-rw-r--r-- | drivers/crypto/ccree/cc_buffer_mgr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c b/drivers/crypto/ccree/cc_buffer_mgr.c index 32d2df36ced2..237a87a57830 100644 --- a/drivers/crypto/ccree/cc_buffer_mgr.c +++ b/drivers/crypto/ccree/cc_buffer_mgr.c @@ -156,8 +156,11 @@ static int cc_render_buff_to_mlli(struct device *dev, dma_addr_t buff_dma, /* Verify there is no memory overflow*/ new_nents = (*curr_nents + buff_size / CC_MAX_MLLI_ENTRY_SIZE + 1); - if (new_nents > MAX_NUM_OF_TOTAL_MLLI_ENTRIES) + if (new_nents > MAX_NUM_OF_TOTAL_MLLI_ENTRIES) { + dev_err(dev, "Too many mlli entries. current %d max %d\n", + new_nents, MAX_NUM_OF_TOTAL_MLLI_ENTRIES); return -ENOMEM; + } /*handle buffer longer than 64 kbytes */ while (buff_size > CC_MAX_MLLI_ENTRY_SIZE) { |