mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
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>
This commit is contained in:
parent
fa1a8c23eb
commit
523ded71de
4 changed files with 29 additions and 13 deletions
|
@ -80,7 +80,7 @@ struct sysfs_ops {
|
|||
#ifdef CONFIG_SYSFS
|
||||
|
||||
extern int sysfs_schedule_callback(struct kobject *kobj,
|
||||
void (*func)(void *), void *data);
|
||||
void (*func)(void *), void *data, struct module *owner);
|
||||
|
||||
extern int __must_check
|
||||
sysfs_create_dir(struct kobject *, struct dentry *);
|
||||
|
@ -137,7 +137,7 @@ extern int __must_check sysfs_init(void);
|
|||
#else /* CONFIG_SYSFS */
|
||||
|
||||
static inline int sysfs_schedule_callback(struct kobject *kobj,
|
||||
void (*func)(void *), void *data)
|
||||
void (*func)(void *), void *data, struct module *owner)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue