Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1686366 > unrolled thread

[PATCH 08/12] staging: ccree: avoid constant comparison

Started byGilad Ben-Yossef <gilad@benyossef.com>
First post2017-07-13 10:30 +0200
Last post2017-07-13 10:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 08/12] staging: ccree: avoid constant comparison Gilad Ben-Yossef <gilad@benyossef.com> - 2017-07-13 10:30 +0200

#1686366 — [PATCH 08/12] staging: ccree: avoid constant comparison

FromGilad Ben-Yossef <gilad@benyossef.com>
Date2017-07-13 10:30 +0200
Subject[PATCH 08/12] staging: ccree: avoid constant comparison
Message-ID<u2HFv-3bI-9@gated-at.bofh.it>
Re-write predicate to avoid constant comparison.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
---
 drivers/staging/ccree/ssi_aead.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c
index dab4914..8a1c408 100644
--- a/drivers/staging/ccree/ssi_aead.c
+++ b/drivers/staging/ccree/ssi_aead.c
@@ -1573,7 +1573,7 @@ static int config_ccm_adata(struct aead_request *req)
 
 	/* taken from crypto/ccm.c */
 	/* 2 <= L <= 8, so 1 <= L' <= 7. */
-	if (2 > l || l > 8) {
+	if (l < 2 || l > 8) {
 		SSI_LOG_ERR("illegal iv value %X\n", req->iv[0]);
 		return -EINVAL;
 	}
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web