Skip to contentSkip to conversation

hwmon: (f71882fg) Signedness bug in f71882fg_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: (f71882fg) Signedness bug in f71882fg_init()

"address" stores and unsigned short on success but a negative on failure so it needs to be an int.

---
Applies to linux-next. This was introduced in 1f7f944 "hwmon:
(f71882fg) Fix build warning".

drivers/hwmon/f71882fg.c +1 -1
index b6304eb..853f544 100644
@@ -2662,7 +2662,7 @@ exit_device_put:
 static int __init f71882fg_init(void)
 {
 	int err = -ENODEV;
-	unsigned short address;
+	int address;
 	struct f71882fg_sio_data sio_data;
 
 	memset(&sio_data, 0, sizeof(sio_data));
maintainer
#1 lore raw
Quoted 4 lines · Dan Carpenter

"address" stores and unsigned short on success but a negative on failure so it needs to be an int.

Patch merged into the original patch introducing the problem.

Thanks,
Guenter

Quoted 18 lines

---
Applies to linux-next. This was introduced in 1f7f944 "hwmon:
(f71882fg) Fix build warning".

drivers/hwmon/f71882fg.c +1 -1
index b6304eb..853f544 100644
@@ -2662,7 +2662,7 @@ exit_device_put:
 static int __init f71882fg_init(void)
 {
 	int err = -ENODEV;
-	unsigned short address;
+	int address;
 	struct f71882fg_sio_data sio_data;
 
 	memset(&sio_data, 0, sizeof(sio_data));