Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754722AbYFWXIB (ORCPT ); Mon, 23 Jun 2008 19:08:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753092AbYFWXHK (ORCPT ); Mon, 23 Jun 2008 19:07:10 -0400 Received: from cantor.suse.de ([195.135.220.2]:44468 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbYFWXHI (ORCPT ); Mon, 23 Jun 2008 19:07:08 -0400 Date: Mon, 23 Jun 2008 16:04:48 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, "Mark M. Hoffman" , "Darrick J. Wong" , Jean Delvare Subject: [patch 09/10] hwmon: (adt7473) Initialize max_duty_at_overheat before use Message-ID: <20080623230448.GC29853@suse.de> References: <20080623225737.837265824@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="patch-hwmon-initialize-max_duty_at_overheat-before-use.patch" In-Reply-To: <20080623230417.GA29853@suse.de> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1257 Lines: 41 2.6.25.9-stable review patch. If anyone has any objections, please let us know. ------------------ From: Jean Delvare 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 Acked-by: Darrick J. Wong Signed-off-by: Mark M. Hoffman Signed-off-by: Greg Kroah-Hartman --- 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; -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/