From patchwork Thu Jul 13 08:19:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 107586 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1910249qge; Thu, 13 Jul 2017 01:22:15 -0700 (PDT) X-Received: by 10.98.88.66 with SMTP id m63mr54946982pfb.51.1499934135455; Thu, 13 Jul 2017 01:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499934135; cv=none; d=google.com; s=arc-20160816; b=oqb9PQx/pJF4d94pwt16zJ1t8kEsKT7CiIBik0KpxHg7t7hkjPhx0TgK/pDHmMRoLc r600Ero1Pxtaxzljb379YCCQWrWMmGwMPs5QrFTxGrzP0+eUwaSWPIDMKQwSwyYj+ThR y4+YTaV6wnXo+GxEyb3+QCu5jFXV02fGzsB9KriIU1MoQHxS7wJ7VGe9UD2VeY3OcQNW zaVPadS04WNCT5QRUMCF8HegoR9FnY6Cf7IrH/S4pnaIVGPBByYTkUKtbuYMXNHnPvMx xsNWuBbSDRguO48PVHaNYToVTi80M30jh5NIPFhJgp4P9Qr+V4OpDNVtDkOpTirnA8PD 0Pig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Wfo7jiqmqBRGKupbEH5oygYi9dzv10PYPIgINwrwFMY=; b=S6C1TD4GVeyJlswdBQNYzYZp/wfuyXXZDO3+W/G0Gc4i5uNv7nID3mjFO71nYIcO1N Uy7kZA4mPPmrq1fEubpVu1lTjVLtbVpbajPnGKbl9brCXUc4gb4WLnXApQjurJw7QL32 NPb+LRjPEZ8EjYnTlgfurLtxtfopGtHHh3QGXtpoKXBzsyyErKl4ZGEPEk2YV6p2Wgx8 Nkk3/zEzYSJUEgV5kdHrMEh9Q8YhwU9X+cf2a+41qzfKPaL1AxomPUop9T2224chYWmr at18VXwJUZcLokbpuxof0AtKa/K7PzQ+XYO/Y74T+vCGR+GFjCRQivKHxG5rMepABEtr rexA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si3968602plk.613.2017.07.13.01.22.15; Thu, 13 Jul 2017 01:22:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752155AbdGMIV7 (ORCPT + 25 others); Thu, 13 Jul 2017 04:21:59 -0400 Received: from foss.arm.com ([217.140.101.70]:34314 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbdGMIU5 (ORCPT ); Thu, 13 Jul 2017 04:20:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 96FEB15B2; Thu, 13 Jul 2017 01:20:46 -0700 (PDT) Received: from gby.kfn.arm.com (unknown [10.45.48.214]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 147A33F3E1; Thu, 13 Jul 2017 01:20:44 -0700 (PDT) From: Gilad Ben-Yossef To: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Ofir Drang Subject: [PATCH 08/12] staging: ccree: avoid constant comparison Date: Thu, 13 Jul 2017 11:19:58 +0300 Message-Id: <1499934004-28513-9-git-send-email-gilad@benyossef.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1499934004-28513-1-git-send-email-gilad@benyossef.com> References: <1499934004-28513-1-git-send-email-gilad@benyossef.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Re-write predicate to avoid constant comparison. Signed-off-by: Gilad Ben-Yossef --- drivers/staging/ccree/ssi_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.1.4 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; }