Skip to contentSkip to conversation

hwmon: (sch56xx-common) signedness bug in sch56xx_init()

PATCH In review Dan Carpenter 2 participants 2 messages Aug 10, 2012

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

PATCH 1/1 hwmon: (sch56xx-common) signedness bug in sch56xx_init()

"address" is used to store an unsigned short on success but a negative error code on failure. It needs to be an int for the error handling to work.

---
This is for linux-next. The bug was introduced in 1645e4fc "hwmon:
(sch56xx-common) Fix build warnings"

drivers/hwmon/sch56xx-common.c +1 -1
index 69abbf7..c93061f5 100644
@@ -594,7 +594,7 @@ exit_device_put:
 
 static int __init sch56xx_init(void)
 {
-	unsigned short address;
+	int address;
 	const char *name = NULL;
 
 	address = sch56xx_find(0x4e, &name);
maintainer
#1 lore raw
Quoted 5 lines · Dan Carpenter

"address" is used to store an unsigned short on success but a negative error code on failure. It needs to be an int for the error handling to work.

Patch merged into the original patch which introduced the problem.

Thanks,
Guenter

Quoted 18 lines

---
This is for linux-next. The bug was introduced in 1645e4fc "hwmon:
(sch56xx-common) Fix build warnings"

drivers/hwmon/sch56xx-common.c +1 -1
index 69abbf7..c93061f5 100644
@@ -594,7 +594,7 @@ exit_device_put:
 
 static int __init sch56xx_init(void)
 {
-	unsigned short address;
+	int address;
 	const char *name = NULL;
 
 	address = sch56xx_find(0x4e, &name);