]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9}
authorTasos Sahanidis <tasos@tasossah.com>
Wed, 12 Mar 2025 03:08:32 +0000 (05:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:32:04 +0000 (14:32 +0200)
commit90c4a3eaa7d52d5405f08e38a9251d8d0ef3a43c
tree940081bdd43cb8b68f1a292416183a6600ca84b4
parent051be169fb7c13b15e719d85a9b5dc83b0a5d00a
hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9}

[ 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.c