linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Off-by-one in /sys/module/*/refcnt
@ 2007-08-05 13:49 Alexey Dobriyan
  2007-08-05 14:00 ` Kay Sievers
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Dobriyan @ 2007-08-05 13:49 UTC (permalink / raw)
  To: akpm; +Cc: gregkh, linux-kernel

Hell knows when this changed, but sysfs is lying about modules refcounts now.

$ cat /sys/module/it87/refcnt
4294967295
$ lsmod | grep ^it87
it87                   15756  0

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 kernel/module.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/module.c
+++ b/kernel/module.c
@@ -785,7 +785,7 @@ 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 = {


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-07  4:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-05 13:49 [PATCH] Off-by-one in /sys/module/*/refcnt Alexey Dobriyan
2007-08-05 14:00 ` Kay Sievers
2007-08-06  5:31   ` Tejun Heo
2007-08-06 19:47     ` [PATCH v2] " Alexey Dobriyan
2007-08-07  4:08       ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).