crypto: ccree - add error message
authorHadar Gat <hadar.gat@arm.com>
Tue, 15 Jan 2019 13:43:12 +0000 (15:43 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Jan 2019 10:41:50 +0000 (18:41 +0800)
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>
drivers/crypto/ccree/cc_buffer_mgr.c

index 32d2df36ced208a16747cf63b0d4fa66bed0569c..237a87a578302aac27b303173a8bb437914fbb76 100644 (file)
@@ -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) {