提交 256e2fdf 编写于 作者: A Alexey Dobriyan 提交者: Greg Kroah-Hartman

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

sysfs internals were changed to not pin module in question.
Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Acked-by: NKay Sievers <kay.sievers@vrfy.org>
Acked-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 6cb52147
...@@ -784,8 +784,7 @@ EXPORT_SYMBOL_GPL(symbol_put_addr); ...@@ -784,8 +784,7 @@ EXPORT_SYMBOL_GPL(symbol_put_addr);
static ssize_t show_refcnt(struct module_attribute *mattr, static ssize_t show_refcnt(struct module_attribute *mattr,
struct module *mod, char *buffer) struct module *mod, char *buffer)
{ {
/* sysfs holds a reference */ return sprintf(buffer, "%u\n", module_refcount(mod));
return sprintf(buffer, "%u\n", module_refcount(mod)-1);
} }
static struct module_attribute refcnt = { static struct module_attribute refcnt = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册