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: <20230211150019.1545542-1-axel.lin@ingics.com>
Date:   Sat, 11 Feb 2023 23:00:19 +0800
From:   Axel Lin <axel.lin@...ics.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Bjorn Andersson <andersson@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        linux-kernel@...r.kernel.org, Axel Lin <axel.lin@...ics.com>
Subject: [PATCH] regulator: max20411: Fix off-by-one for n_voltages setting

Otherwise regulator_list_voltage returns -EINVAL for MAX20411_MAX_SEL.

Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
 drivers/regulator/max20411-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/max20411-regulator.c b/drivers/regulator/max20411-regulator.c
index e75d16048e2f..83dacb4ff173 100644
--- a/drivers/regulator/max20411-regulator.c
+++ b/drivers/regulator/max20411-regulator.c
@@ -85,7 +85,7 @@ static const struct regulator_desc max20411_desc = {
 	.min_uV = MAX20411_BASE_UV,
 	.uV_step = MAX20411_UV_STEP,
 	.linear_min_sel = MAX20411_MIN_SEL,
-	.n_voltages = MAX20411_MAX_SEL,
+	.n_voltages = MAX20411_MAX_SEL + 1,
 
 	.vsel_reg = MAX20411_VID_OFFSET,
 	.vsel_mask = MAX20411_VID_MASK,
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ