staging: ccree: avoid constant comparison
authorGilad Ben-Yossef <gilad@benyossef.com>
Thu, 13 Jul 2017 08:19:58 +0000 (11:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jul 2017 06:41:01 +0000 (08:41 +0200)
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>
drivers/staging/ccree/ssi_aead.c

index d9e342f..46dd708 100644 (file)
@@ -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;
        }