History

Fix Off-by-one in /sys/module/*/refcnt

sysfs internals were changed to not pin module in question.

Alexey Dobriyan committed 19 years ago

Commit 256e2fd1 parent 6cb52141 file · +1 −2Browse files

Showing the changes to kernel/module.c (1 of 1 file). Show all

Unified · Split

kernel/module.c+1−2
@@ -784,8 +784,7 @@ EXPORT_SYMBOL_GPL(symbol_put_addr); · 783 unmodified lines
784static ssize_t show_refcnt(struct module_attribute *mattr,784static ssize_t show_refcnt(struct module_attribute *mattr,
785 struct module *mod, char *buffer)785 struct module *mod, char *buffer)
786{786{
787 /* sysfs holds a reference */787 return sprintf(buffer, "%u\n", module_refcount(mod));
788 return sprintf(buffer, "%u\n", module_refcount(mod)-1);
789}788}
790 789
791static struct module_attribute refcnt = {790static struct module_attribute refcnt = {