]> git.hungrycats.org Git - linux/commitdiff
hwmon: (fschmd) Fix check on unsigned in watchdog_write()
authorRoel Kluin <roel.kluin@gmail.com>
Sat, 24 Oct 2009 11:28:45 +0000 (13:28 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 6 Jan 2010 22:26:38 +0000 (14:26 -0800)
commit c7702c31340f84cfd5e5df22293578b7ae1e9370 upstream.

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/fschmd.c

index ea955edde87e5127fc4c7f57d7d0c0b51ed3b1e4..37ea6a45d25fcd49138def73532f2dcb505a3b9f 100644 (file)
@@ -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) {