mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 22:28:00 +00:00
Fix Off-by-one in /sys/module/*/refcnt
sysfs internals were changed to not pin module in question. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Kay Sievers <kay.sievers@vrfy.org> Acked-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6cb52147b2
commit
256e2fdf03
1 changed files with 1 additions and 2 deletions
|
@ -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 = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue