Skip to contentSkip to conversation

hwmon: (it87) Add missing sysfs attribute group terminator

PATCH Applied Jean Delvare 3 participants 5 messages Aug 29, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 hwmon: (it87) Add missing sysfs attribute group terminator

Attribute array it87_attributes_in lacks its NULL terminator, causing random behavior when operating on the attribute group.

Fixes 52929715634a ("hwmon: (it87) Use is_visible for voltage sensors")
Cc Martin Blumenstingl <[email protected]>
Cc Guenter Roeck <[email protected]>
---
 drivers/hwmon/it87.c |    1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/it87.c +1 -0
@@ -2015,6 +2015,7 @@ static struct attribute *it87_attributes
 	&sensor_dev_attr_in10_input.dev_attr.attr,	/* 41 */
 	&sensor_dev_attr_in11_input.dev_attr.attr,	/* 41 */
 	&sensor_dev_attr_in12_input.dev_attr.attr,	/* 41 */
+	NULL
 };
 
 static const struct attribute_group it87_group_in = {
Signature · 2 lines
Jean Delvare
SUSE L3 Support
#1 lore raw

PATCH 2/2 hwmon: (it87) Drop useless comments

Remove the index comments at the end of it87_attributes_in. They serve no purpose (as there is no reference to them in it87_in_is_visible) and some of them were obviously wrong.

Cc Martin Blumenstingl <[email protected]>
Cc Guenter Roeck <[email protected]>
---
 drivers/hwmon/it87.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/it87.c +4 -4
@@ -2011,10 +2011,10 @@ static struct attribute *it87_attributes
 	&sensor_dev_attr_in7_beep.dev_attr.attr,	/* 39 */
 
 	&sensor_dev_attr_in8_input.dev_attr.attr,	/* 40 */
-	&sensor_dev_attr_in9_input.dev_attr.attr,	/* 41 */
-	&sensor_dev_attr_in10_input.dev_attr.attr,	/* 41 */
-	&sensor_dev_attr_in11_input.dev_attr.attr,	/* 41 */
-	&sensor_dev_attr_in12_input.dev_attr.attr,	/* 41 */
+	&sensor_dev_attr_in9_input.dev_attr.attr,
+	&sensor_dev_attr_in10_input.dev_attr.attr,
+	&sensor_dev_attr_in11_input.dev_attr.attr,
+	&sensor_dev_attr_in12_input.dev_attr.attr,
 	NULL
 };
 
Signature · 2 lines
Jean Delvare
SUSE L3 Support
maintainer Applied
#2 lore raw

Re: [PATCH 2/2] hwmon: (it87) Drop useless comments

Quoted 7 lines · Jean Delvare

Remove the index comments at the end of it87_attributes_in. They serve no purpose (as there is no reference to them in it87_in_is_visible) and some of them were obviously wrong.

Cc Martin Blumenstingl <[email protected]>
Cc Guenter Roeck <[email protected]>

Applied to -next.

Thanks,
Guenter

Quoted 25 lines
---
 drivers/hwmon/it87.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/hwmon/it87.c +4 -4
@@ -2011,10 +2011,10 @@ static struct attribute *it87_attributes
 	&sensor_dev_attr_in7_beep.dev_attr.attr,	/* 39 */
 
 	&sensor_dev_attr_in8_input.dev_attr.attr,	/* 40 */
-	&sensor_dev_attr_in9_input.dev_attr.attr,	/* 41 */
-	&sensor_dev_attr_in10_input.dev_attr.attr,	/* 41 */
-	&sensor_dev_attr_in11_input.dev_attr.attr,	/* 41 */
-	&sensor_dev_attr_in12_input.dev_attr.attr,	/* 41 */
+	&sensor_dev_attr_in9_input.dev_attr.attr,
+	&sensor_dev_attr_in10_input.dev_attr.attr,
+	&sensor_dev_attr_in11_input.dev_attr.attr,
+	&sensor_dev_attr_in12_input.dev_attr.attr,
 	NULL
 };
 
Signature · 3 lines
-- 
Jean Delvare
SUSE L3 Support
maintainer Applied
#3 lore raw
In reply to Jean Delvare
Quoted 8 lines · Jean Delvare

Attribute array it87_attributes_in lacks its NULL terminator, causing random behavior when operating on the attribute group.

Fixes 52929715634a ("hwmon: (it87) Use is_visible for voltage sensors")
Cc Martin Blumenstingl <[email protected]>
Cc Guenter Roeck <[email protected]>

Applied.

Thanks,
Guenter

Quoted 19 lines
---
 drivers/hwmon/it87.c |    1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/it87.c +1 -0
@@ -2015,6 +2015,7 @@ static struct attribute *it87_attributes
 	&sensor_dev_attr_in10_input.dev_attr.attr,	/* 41 */
 	&sensor_dev_attr_in11_input.dev_attr.attr,	/* 41 */
 	&sensor_dev_attr_in12_input.dev_attr.attr,	/* 41 */
+	NULL
 };
 
 static const struct attribute_group it87_group_in = {
Signature · 3 lines
-- 
Jean Delvare
SUSE L3 Support
#4 lore raw
Quoted 28 lines · Guenter Roeck
Quoted 8 lines · Jean Delvare

Attribute array it87_attributes_in lacks its NULL terminator, causing random behavior when operating on the attribute group.

Fixes 52929715634a ("hwmon: (it87) Use is_visible for voltage sensors")
Cc Martin Blumenstingl <[email protected]>
Cc Guenter Roeck <[email protected]>

Applied.

Thanks,
Guenter

Quoted 13 lines
---
 drivers/hwmon/it87.c |    1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/it87.c 2016-08-29 12:04:52.926911625 +0200 renamed from drivers/hwmon/it87.c 2016-07-04 08:01:00.000000000 +0200 +1 -0
@@ -2015,6 +2015,7 @@ static struct attribute *it87_attributes
      &sensor_dev_attr_in10_input.dev_attr.attr,      /* 41 */
      &sensor_dev_attr_in11_input.dev_attr.attr,      /* 41 */
      &sensor_dev_attr_in12_input.dev_attr.attr,      /* 41 */
+     NULL
 };
 
Quoted 6 lines
Quoted 6 lines
drivers/hwmon/it87.c 2016-08-29 12:04:52.926911625 +0200 renamed from drivers/hwmon/it87.c 2016-07-04 08:01:00.000000000 +0200 +0 -1
 static const struct attribute_group it87_group_in = {
 
 
--

Jean Delvare
SUSE L3 Support

Just a quick note to confirm that the above patch does fix the it87.ko oops issue for me.

Thanks very much.

Alexander.