lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131216104222.GA19404@elgon.mountain>
Date:	Mon, 16 Dec 2013 13:42:22 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Linus Walleij <linus.walleij@...aro.org>,
	Bjorn Andersson <bjorn.andersson@...ymobile.com>
Cc:	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] pinctrl: off by one in msm_config_group_set()

This should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".

Fixes: f365be092572 ('pinctrl: Add Qualcomm TLMM driver')
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/drivers/pinctrl/pinctrl-msm.c b/drivers/pinctrl/pinctrl-msm.c
index 28b90aba708d..03c4e615ebb8 100644
--- a/drivers/pinctrl/pinctrl-msm.c
+++ b/drivers/pinctrl/pinctrl-msm.c
@@ -350,7 +350,7 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
 			break;
 		case PIN_CONFIG_DRIVE_STRENGTH:
 			/* Check for invalid values */
-			if (arg > ARRAY_SIZE(msm_drive_to_regval))
+			if (arg >= ARRAY_SIZE(msm_drive_to_regval))
 				arg = -1;
 			else
 				arg = msm_drive_to_regval[arg];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ