diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-01-31 04:00:30 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-15 08:49:46 -0700 |
commit | 23e87a47dce919c82073e0ab0b741f35954c7512 (patch) | |
tree | d9c9711fc5e62e7ad8cd917e2208cad31c5a5fa4 /drivers/hwmon/ams/ams.h | |
parent | 7ec291833eb21e96fc62f58ce14076bf01d14e97 (diff) | |
download | lwn-23e87a47dce919c82073e0ab0b741f35954c7512.tar.gz lwn-23e87a47dce919c82073e0ab0b741f35954c7512.zip |
macintosh/therm_adt746x: Fix sysfs attributes lifetime
commit 33a470f6d5e1879c26f16f6b34dc09f82d44f6e9 upstream.
Looking at drivers/macintosh/therm_adt746x.c, the sysfs files are
created in thermostat_init() and removed in thermostat_exit(), which
are the driver's init and exit functions. These files are backed-up by
a per-device structure, so it looks like the wrong thing to do: the
sysfs files have a lifetime longer than the data structure that is
backing it up.
I think that sysfs files creation should be moved to the end of
probe_thermostat() and sysfs files removal should be moved to the
beginning of remove_thermostat().
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Christian Kujau <lists@nerdbynature.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Colin Leroy <colin@colino.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon/ams/ams.h')
0 files changed, 0 insertions, 0 deletions