[PATCH 2/5] Fix Off-by-one in /sys/module/*/refcnt

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: Alexey Dobriyan <adobriyan@...>, Greg Kroah-Hartman <gregkh@...>
Date: Wednesday, August 22, 2007 - 6:10 pm

From: Alexey Dobriyan <adobriyan@gmail.com>

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>
---
 kernel/module.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 33c04ad..db0ead0 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 = {
-- 
1.5.3.rc5

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] driver core fixes for 2.6.23-rc3, Greg KH, (Wed Aug 22, 6:07 pm)
[PATCH 1/5] sysfs: fix locking in sysfs_lookup() and sysfs_r..., Greg Kroah-Hartman, (Wed Aug 22, 6:10 pm)
[PATCH 2/5] Fix Off-by-one in /sys/module/*/refcnt, Greg Kroah-Hartman, (Wed Aug 22, 6:10 pm)
[PATCH 3/5] HOWTO: korean translation of Documentation/HOWTO, Greg Kroah-Hartman, (Wed Aug 22, 6:10 pm)
[PATCH 4/5] HOWTO: latest lxr url address changed, Greg Kroah-Hartman, (Wed Aug 22, 6:10 pm)
[PATCH 5/5] sysfs: don't warn on removal of a nonexistent bi..., Greg Kroah-Hartman, (Wed Aug 22, 6:10 pm)