Skip to contentSkip to conversation

hwmon: Fix check on unsigned in

PATCH In review Roel Kluin 2 participants 2 messages Oct 16, 2009 – Oct 17, 2009 Hardware monitoring

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 hwmon: Fix check on unsigned in

If unsigned the watchdog_trigger() return value will not be checked correctly.

---

drivers/hwmon/fschmd.c +1 -1
index 2a7a85a..da1b1f9 100644
@@ -819,7 +819,7 @@ static int watchdog_release(struct inode *inode, struct file *filp)
 static ssize_t watchdog_write(struct file *filp, const char __user *buf,
 	size_t count, loff_t *offset)
 {
-	size_t ret;
+	int ret;
 	struct fschmd_data *data = filp->private_data;
 
 	if (count) {

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

#1 lore raw
Quoted 10 lines · Roel Kluin

If unsigned the watchdog_trigger() return value will not be checked correctly.

---

drivers/hwmon/fschmd.c +0 -0
index 2a7a85a..da1b1f9 100644

drivers/hwmon/fschmd.c static int watchdog_release(struct inode *inode, struct file *filp) · line 825

Quoted 8 lines
drivers/hwmon/fschmd.c +1 -1
@@ -819,7 +819,7 @@ static int watchdog_release(struct inode *inode, struct file *filp)
 static ssize_t watchdog_write(struct file *filp, const char __user *buf,
 	size_t count, loff_t *offset)
 {
-	size_t ret;
+	int ret;
 	struct fschmd_data *data = filp->private_data;
 
 	if (count) {

Good catch. Patch applied, thanks.

Signature · 6 lines
Jean Delvare

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