From: Alexey Dobriyan Date: Mon, 6 Aug 2007 19:47:45 +0000 (+0400) Subject: Fix Off-by-one in /sys/module/*/refcnt X-Git-Tag: v2.6.23-rc4~30^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=256e2fdf033f5c8b5093cd817d44cea3a11a4e6f;p=linux-2.6 Fix Off-by-one in /sys/module/*/refcnt sysfs internals were changed to not pin module in question. Signed-off-by: Alexey Dobriyan Acked-by: Kay Sievers Acked-by: Tejun Heo Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/module.c b/kernel/module.c index 33c04ad511..db0ead0363 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -784,8 +784,7 @@ EXPORT_SYMBOL_GPL(symbol_put_addr); static ssize_t show_refcnt(struct module_attribute *mattr, struct module *mod, char *buffer) { - /* sysfs holds a reference */ - return sprintf(buffer, "%u\n", module_refcount(mod)-1); + return sprintf(buffer, "%u\n", module_refcount(mod)); } static struct module_attribute refcnt = {