* [PATCH AUTOSEL 6.1 3/3] hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9}
[not found] <20250325184258.2152379-1-sashal@kernel.org>
@ 2025-03-25 18:42 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2025-03-25 18:42 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Tasos Sahanidis, Guenter Roeck, Sasha Levin, jdelvare,
linux-hwmon
From: Tasos Sahanidis <tasos@tasossah.com>
[ Upstream commit 815f80ad20b63830949a77c816e35395d5d55144 ]
pwm_num is set to 7 for these chips, but NCT6776_REG_PWM_MODE and
NCT6776_PWM_MODE_MASK only contain 6 values.
Fix this by adding another 0 to the end of each array.
Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
Link: https://lore.kernel.org/r/20250312030832.106475-1-tasos@tasossah.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/nct6775-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 9de3ad2713f1d..ec3ff4e9a9abd 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -276,8 +276,8 @@ static const s8 NCT6776_BEEP_BITS[] = {
static const u16 NCT6776_REG_TOLERANCE_H[] = {
0x10c, 0x20c, 0x30c, 0x80c, 0x90c, 0xa0c, 0xb0c };
-static const u8 NCT6776_REG_PWM_MODE[] = { 0x04, 0, 0, 0, 0, 0 };
-static const u8 NCT6776_PWM_MODE_MASK[] = { 0x01, 0, 0, 0, 0, 0 };
+static const u8 NCT6776_REG_PWM_MODE[] = { 0x04, 0, 0, 0, 0, 0, 0 };
+static const u8 NCT6776_PWM_MODE_MASK[] = { 0x01, 0, 0, 0, 0, 0, 0 };
static const u16 NCT6776_REG_FAN_MIN[] = {
0x63a, 0x63c, 0x63e, 0x640, 0x642, 0x64a, 0x64c };
--
2.39.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-25 18:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250325184258.2152379-1-sashal@kernel.org>
2025-03-25 18:42 ` [PATCH AUTOSEL 6.1 3/3] hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9} Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox