All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (aquacomputer_d5next) Fix length of speed_input array
@ 2024-11-24 15:27 Aleksa Savic
  2024-11-24 15:35 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Aleksa Savic @ 2024-11-24 15:27 UTC (permalink / raw)
  To: linux-hwmon
  Cc: Aleksa Savic, Arne Schwabe, Jack Doan, Jean Delvare,
	Guenter Roeck, linux-kernel

Commit 120584c728a6 ("hwmon: (aquacomputer_d5next) Add support for Octo
flow sensor") added support for reading Octo flow sensor, but didn't
update the priv->speed_input array length. Since Octo has 8 fans, with
the addition of the flow sensor the proper length for speed_input is 9.

Reported by Arne Schwabe on Github [1], who received a UBSAN warning.

[1]: https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/issues/100

Fixes: 120584c728a6 ("hwmon: (aquacomputer_d5next) Add support for Octo flow sensor")
Reported-by: Arne Schwabe <arne@rfc2549.org>
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
---
 drivers/hwmon/aquacomputer_d5next.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c
index 34cac27e4dde..0dcb8a3a691d 100644
--- a/drivers/hwmon/aquacomputer_d5next.c
+++ b/drivers/hwmon/aquacomputer_d5next.c
@@ -597,7 +597,7 @@ struct aqc_data {
 
 	/* Sensor values */
 	s32 temp_input[20];	/* Max 4 physical and 16 virtual or 8 physical and 12 virtual */
-	s32 speed_input[8];
+	s32 speed_input[9];
 	u32 speed_input_min[1];
 	u32 speed_input_target[1];
 	u32 speed_input_max[1];
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-24 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-24 15:27 [PATCH] hwmon: (aquacomputer_d5next) Fix length of speed_input array Aleksa Savic
2024-11-24 15:35 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.