diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-04-26 03:12:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 13:57:32 -0400 |
commit | 523ded71de0c5e66973335bf99a80edfda9f401b (patch) | |
tree | 20f47e8ed91018977d9fb7f4169a6ef8db407b82 /include/linux/sysfs.h | |
parent | fa1a8c23eb7d3ded8a3c6d0e653339a2bc7fca9e (diff) |
device_schedule_callback() needs a module reference
This patch (as896b) fixes an oversight in the design of
device_schedule_callback(). It is necessary to acquire a reference to the
module owning the callback routine, to prevent the module from being
unloaded before the callback can run.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Satyam Sharma <satyam.sharma@gmail.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index fea9a6b3fb7b..7d5d1ec95c2e 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -80,7 +80,7 @@ struct sysfs_ops { | |||
80 | #ifdef CONFIG_SYSFS | 80 | #ifdef CONFIG_SYSFS |
81 | 81 | ||
82 | extern int sysfs_schedule_callback(struct kobject *kobj, | 82 | extern int sysfs_schedule_callback(struct kobject *kobj, |
83 | void (*func)(void *), void *data); | 83 | void (*func)(void *), void *data, struct module *owner); |
84 | 84 | ||
85 | extern int __must_check | 85 | extern int __must_check |
86 | sysfs_create_dir(struct kobject *, struct dentry *); | 86 | sysfs_create_dir(struct kobject *, struct dentry *); |
@@ -137,7 +137,7 @@ extern int __must_check sysfs_init(void); | |||
137 | #else /* CONFIG_SYSFS */ | 137 | #else /* CONFIG_SYSFS */ |
138 | 138 | ||
139 | static inline int sysfs_schedule_callback(struct kobject *kobj, | 139 | static inline int sysfs_schedule_callback(struct kobject *kobj, |
140 | void (*func)(void *), void *data) | 140 | void (*func)(void *), void *data, struct module *owner) |
141 | { | 141 | { |
142 | return -ENOSYS; | 142 | return -ENOSYS; |
143 | } | 143 | } |