linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gilad Ben-Yossef <gilad@benyossef.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Cc: Hadar Gat <hadar.gat@arm.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] crypto: ccree: add error message
Date: Tue, 15 Jan 2019 15:43:12 +0200	[thread overview]
Message-ID: <20190115134318.28712-3-gilad@benyossef.com> (raw)
In-Reply-To: <20190115134318.28712-1-gilad@benyossef.com>

From: Hadar Gat <hadar.gat@arm.com>

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>
---
 drivers/crypto/ccree/cc_buffer_mgr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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) {
-- 
2.20.1


  parent reply	other threads:[~2019-01-15 13:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 13:43 [PATCH 0/7] bug fixes and cleanups Gilad Ben-Yossef
2019-01-15 13:43 ` [PATCH 1/7] crypto: ccree: improve error handling Gilad Ben-Yossef
2019-01-15 13:43 ` Gilad Ben-Yossef [this message]
2019-01-15 13:43 ` [PATCH 3/7] crypto: ccree: fix free of unallocated mlli buffer Gilad Ben-Yossef
2019-01-15 13:43 ` [PATCH 4/7] crypto: ccree: remove legacy leftover Gilad Ben-Yossef
2019-01-15 13:43 ` [PATCH 5/7] crypto: ccree: unmap buffer before copying IV Gilad Ben-Yossef
2019-01-15 13:43 ` [PATCH 6/7] crypto: ccree: shared irq lines are not a bug Gilad Ben-Yossef
2019-01-15 13:43 ` [PATCH 7/7] crypto: ccree: don't copy zero size ciphertext Gilad Ben-Yossef
2019-01-25 10:46 ` [PATCH 0/7] bug fixes and cleanups Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190115134318.28712-3-gilad@benyossef.com \
    --to=gilad@benyossef.com \
    --cc=davem@davemloft.net \
    --cc=hadar.gat@arm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).