diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-11-15 16:58:24 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-11-15 16:58:24 -0800 |
commit | 4f415b7205b018e1a5f67913d5a01cdbaf2a1ce2 (patch) | |
tree | 2c880d81c0e59eb62033daf6d533694257779437 /i2c | |
parent | 9f1231dc9f682705be7b514575682e57f2cac5d2 (diff) | |
download | patches-4f415b7205b018e1a5f67913d5a01cdbaf2a1ce2.tar.gz |
new hwmon patches
Diffstat (limited to 'i2c')
-rw-r--r-- | i2c/hwmon-lm78-fix-vid.patch | 31 | ||||
-rw-r--r-- | i2c/hwmon-w83627hf-missing-in0-limit-check.patch | 44 |
2 files changed, 75 insertions, 0 deletions
diff --git a/i2c/hwmon-lm78-fix-vid.patch b/i2c/hwmon-lm78-fix-vid.patch new file mode 100644 index 0000000000000..38c48750ba1aa --- /dev/null +++ b/i2c/hwmon-lm78-fix-vid.patch @@ -0,0 +1,31 @@ +From khali@linux-fr.org Mon Nov 14 14:00:46 2005 +Date: Mon, 14 Nov 2005 23:11:45 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Subject: hwmon: Fix lm78 VID conversion +Message-Id: <20051114231145.670478d0.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-lm78-fix-vid.patch + +Fix the lm78 VID reading, which I accidentally broke while making +this driver use the common vid_from_reg function rather than +reimplementing its own in 2.6.14-rc1. + +I'm not proud of it, trust me. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/hwmon/lm78.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/hwmon/lm78.c ++++ gregkh-2.6/drivers/hwmon/lm78.c +@@ -451,7 +451,7 @@ static DEVICE_ATTR(fan3_div, S_IRUGO, sh + static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) + { + struct lm78_data *data = lm78_update_device(dev); +- return sprintf(buf, "%d\n", vid_from_reg(82, data->vid)); ++ return sprintf(buf, "%d\n", vid_from_reg(data->vid, 82)); + } + static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); + diff --git a/i2c/hwmon-w83627hf-missing-in0-limit-check.patch b/i2c/hwmon-w83627hf-missing-in0-limit-check.patch new file mode 100644 index 0000000000000..e486dd51f8ac4 --- /dev/null +++ b/i2c/hwmon-w83627hf-missing-in0-limit-check.patch @@ -0,0 +1,44 @@ +From khali@linux-fr.org Mon Nov 14 13:55:35 2005 +Date: Mon, 14 Nov 2005 23:08:38 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Yuan Mu <Ymu@winbond.com.tw> +Subject: [PATCH] hwmon: Fix missing boundary check when setting W83627THF in0 limits +Message-Id: <20051114230838.37a9f2d8.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-w83627hf-missing-in0-limit-check.patch + +From: Yuan Mu <Ymu@winbond.com.tw> + +Add SENSORS_LIMIT in store VCore limit functions. This fixes a potential +u8 overflow on out-of-range user input. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/hwmon/w83627hf.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/drivers/hwmon/w83627hf.c ++++ gregkh-2.6/drivers/hwmon/w83627hf.c +@@ -456,7 +456,9 @@ static ssize_t store_regs_in_min0(struct + (w83627thf == data->type || w83637hf == data->type)) + + /* use VRM9 calculation */ +- data->in_min[0] = (u8)(((val * 100) - 70000 + 244) / 488); ++ data->in_min[0] = ++ SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0, ++ 255); + else + /* use VRM8 (standard) calculation */ + data->in_min[0] = IN_TO_REG(val); +@@ -481,7 +483,9 @@ static ssize_t store_regs_in_max0(struct + (w83627thf == data->type || w83637hf == data->type)) + + /* use VRM9 calculation */ +- data->in_max[0] = (u8)(((val * 100) - 70000 + 244) / 488); ++ data->in_max[0] = ++ SENSORS_LIMIT(((val * 100) - 70000 + 244) / 488, 0, ++ 255); + else + /* use VRM8 (standard) calculation */ + data->in_max[0] = IN_TO_REG(val); |