Skip to content

Commit

Permalink
crypto: ccree - add error message
Browse files Browse the repository at this point in the history
Add error message in case of too many mlli entries.

Signed-off-by: Hadar Gat <[email protected]>
Signed-off-by: Gilad Ben-Yossef <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
hadargat authored and herbertx committed Jan 25, 2019
1 parent ccba2f1 commit 32be4c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/crypto/ccree/cc_buffer_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 32be4c5

Please sign in to comment.