All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] crypto/dpaa_sec: improve the error checking
@ 2018-04-05  8:35 Hemant Agrawal
  2018-04-05  8:35 ` [PATCH 2/2] crypto/dpaa2_sec: improve error handling Hemant Agrawal
  2018-04-16  9:13 ` [PATCH 1/2] crypto/dpaa_sec: improve the error checking Akhil Goyal
  0 siblings, 2 replies; 6+ messages in thread
From: Hemant Agrawal @ 2018-04-05  8:35 UTC (permalink / raw)
  To: dev; +Cc: pablo.de.lara.guarch, akhil.goyal, dpdk-up

From: Sunil Kumar Kori <sunil.kori@nxp.com>

Reported by NXP's internal coverity

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index c5191ce..79ccb22 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -388,7 +388,7 @@ static int
 dpaa_sec_prep_cdb(dpaa_sec_session *ses)
 {
 	struct alginfo alginfo_c = {0}, alginfo_a = {0}, alginfo = {0};
-	uint32_t shared_desc_len = 0;
+	int32_t shared_desc_len = 0;
 	struct sec_cdb *cdb = &ses->cdb;
 	int err;
 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
@@ -530,6 +530,12 @@ dpaa_sec_prep_cdb(dpaa_sec_session *ses)
 					ses->digest_length, ses->dir);
 		}
 	}
+
+	if (shared_desc_len < 0) {
+		PMD_TX_LOG(ERR, "error in preparing command block\n");
+		return shared_desc_len;
+	}
+
 	cdb->sh_hdr.hi.field.idlen = shared_desc_len;
 	cdb->sh_hdr.hi.word = rte_cpu_to_be_32(cdb->sh_hdr.hi.word);
 	cdb->sh_hdr.lo.word = rte_cpu_to_be_32(cdb->sh_hdr.lo.word);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-17 14:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05  8:35 [PATCH 1/2] crypto/dpaa_sec: improve the error checking Hemant Agrawal
2018-04-05  8:35 ` [PATCH 2/2] crypto/dpaa2_sec: improve error handling Hemant Agrawal
2018-04-16  9:14   ` Akhil Goyal
2018-04-17 14:42     ` De Lara Guarch, Pablo
2018-04-16  9:13 ` [PATCH 1/2] crypto/dpaa_sec: improve the error checking Akhil Goyal
2018-04-17 14:42   ` De Lara Guarch, Pablo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.