浏览代码

staging: ccree: avoid constant comparison

Re-write predicate to avoid constant comparison.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gilad Ben-Yossef 8 年之前
父节点
当前提交
079a7174ae
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/staging/ccree/ssi_aead.c

+ 1 - 1
drivers/staging/ccree/ssi_aead.c

@@ -1572,7 +1572,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;
 	}