public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 2/5] Fix Off-by-one in /sys/module/*/refcnt
Date: Wed, 22 Aug 2007 15:10:17 -0700	[thread overview]
Message-ID: <11878206273940-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <1187820620110-git-send-email-gregkh@suse.de>

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


  reply	other threads:[~2007-08-22 22:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22 22:07 [GIT PATCH] driver core fixes for 2.6.23-rc3 Greg KH
2007-08-22 22:10 ` [PATCH 1/5] sysfs: fix locking in sysfs_lookup() and sysfs_rename_dir() Greg Kroah-Hartman
2007-08-22 22:10   ` Greg Kroah-Hartman [this message]
2007-08-22 22:10     ` [PATCH 3/5] HOWTO: korean translation of Documentation/HOWTO Greg Kroah-Hartman
2007-08-22 22:10       ` [PATCH 4/5] HOWTO: latest lxr url address changed Greg Kroah-Hartman
2007-08-22 22:10         ` [PATCH 5/5] sysfs: don't warn on removal of a nonexistent binary file Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11878206273940-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox