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
784784 static ssize_t show_refcnt(struct module_attribute *mattr,
785785 struct module *mod, char *buffer)
786786 {
787− /* sysfs holds a reference */
788− return sprintf(buffer, "%u\n", module_refcount(mod)-1);
787+ return sprintf(buffer, "%u\n", module_refcount(mod));
789788 }
790789
791790 static struct module_attribute refcnt = {