[patch 09/10] hwmon: (adt7473) Initialize max_duty_at_overheat before use

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, Willy Tarreau <w@...>, Rodrigo Rubira Branco <rbranco@...>, <torvalds@...>, <akpm@...>, <alan@...>, Mark M. Hoffman <mhoffman@...>, Darrick J. Wong <djwong@...>, Jean Delvare <khali@...>
Date: Monday, June 23, 2008 - 7:04 pm

2.6.25.9-stable review patch.  If anyone has any objections, please let
us know.

------------------ 
From: Jean Delvare <khali@linux-fr.org>

commit ed4ec814e45ae8b1596aea0a29b92f6c3614acaa upstream

data->max_duty_at_overheat is not updated in adt7473_update_device,
so it might be used before it is initialized (if the user reads from
sysfs file max_duty_at_crit before writing to it.)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 drivers/hwmon/adt7473.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/hwmon/adt7473.c
+++ b/drivers/hwmon/adt7473.c
@@ -309,6 +309,9 @@ no_sensor_update:
 						ADT7473_REG_PWM_BHVR(i));
 	}
 
+	i = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4);
+	data->max_duty_at_overheat = !!(i & ADT7473_CFG4_MAX_DUTY_AT_OVT);
+
 	data->limits_last_updated = local_jiffies;
 	data->limits_valid = 1;
 

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/10] 2.6.28.9-rc2 review, Greg KH, (Mon Jun 23, 7:04 pm)
Re: [patch 00/10] 2.6.28.9-rc2 review, Greg KH, (Mon Jun 23, 7:22 pm)
[patch 10/10] Fix ZERO_PAGE breakage with vmware, Greg KH, (Mon Jun 23, 7:04 pm)
Re: [patch 10/10] Fix ZERO_PAGE breakage with vmware, Linus Torvalds, (Mon Jun 23, 7:28 pm)
[patch 09/10] hwmon: (adt7473) Initialize max_duty_at_overhe..., Greg KH, (Mon Jun 23, 7:04 pm)