Skip to contentSkip to conversation

hwmon: (tmp401) Fix off-by-one error in chip

PATCH In review Andre Prendel 3 participants 4 messages Jun 2, 2009 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (tmp401) Fix off-by-one error in chip

This patch fixes an off-by-one error in chip detection output.

I2C kind starts with 1, so this cannot be used directly as the array index.

---

drivers/hwmon/tmp401.c +1 -1
@@ -576,7 +576,7 @@
 		goto exit_remove;
 	}
 	dev_info(&client->dev, "Detected TI %s chip\n",
-		 names[data->kind]);
+		 names[data->kind - 1]);
 
 	return 0;
 

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Acked-by on v1 1/1
#1 lore raw

Re: [lm-sensors] [PATCH] hwmon: (tmp401) Fix off-by-one error in

Good catch!

Quoted 9 lines · Andre Prendel

This patch fixes an off-by-one error in chip detection output.

I2C kind starts with 1, so this cannot be used directly as the array index.

---

drivers/hwmon/tmp401.c line 582

Quoted 8 lines
drivers/hwmon/tmp401.c +1 -1
@@ -576,7 +576,7 @@
  		goto exit_remove;
  	}
  	dev_info(&client->dev, "Detected TI %s chip\n",
-		 names[data->kind]);
+		 names[data->kind - 1]);
 
  	return 0;
 

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw

Re: [lm-sensors] [PATCH] hwmon: (tmp401) Fix off-by-one error

In reply to Andre Prendel
Quoted 1 line · Hans de Goede

Good catch!

Unfortunately this bug was introduced by myself :( I didn't read your code from fschmd carefully enough.

Andre

Quoted 18 lines
Quoted 15 lines · Andre Prendel

This patch fixes an off-by-one error in chip detection output.

I2C kind starts with 1, so this cannot be used directly as the array index.

---

drivers/hwmon/tmp401.c +1 -1
@@ -576,7 +576,7 @@
  		goto exit_remove;
  	}
  	dev_info(&client->dev, "Detected TI %s chip\n",
-		 names[data->kind]);
+		 names[data->kind - 1]);
 
Quoted 7 lines

drivers/hwmon/tmp401.c line 582

Quoted 2 lines
drivers/hwmon/tmp401.c +0 -0
  	return 0;
 

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw

Re: [lm-sensors] [PATCH] hwmon: (tmp401) Fix off-by-one error in

In reply to Andre Prendel
Quoted 5 lines · Andre Prendel
Quoted 1 line · Hans de Goede

Good catch!

Unfortunately this bug was introduced by myself :( I didn't read your code from fschmd carefully enough.

The patch which introduces the bug isn't merged yet, so I will simply fold the fix into that patch. Thanks!

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors