From: Chun Wu <chun.wu84@gmail.com>
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org, Chun Wu <chun.wu84@gmail.com>
Subject: [PATCH] block: missing module_put in put_disk
Date: Fri, 29 Oct 2010 11:51:35 -0400 [thread overview]
Message-ID: <1288367495-2919-1-git-send-email-chun@gmail.com> (raw)
From: Chun Wu <chun.wu84@gmail.com>
module_put function is not called in put_disk function. Should it be added?
Signed-off-by: Chun Wu <chun.wu84@gmail.com>
---
block/genhd.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 5fa2b44..91299dc 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1228,6 +1228,13 @@ EXPORT_SYMBOL(get_disk);
void put_disk(struct gendisk *disk)
{
+#ifdef CONFIG_MODULE_UNLOAD
+ struct module *owner;
+
+ owner = disk->fops->owner;
+ if (owner)
+ module_put(owner);
+#endif
if (disk)
kobject_put(&disk_to_dev(disk)->kobj);
}
--
1.5.6.5
next reply other threads:[~2010-10-29 15:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-29 15:51 Chun Wu [this message]
2010-10-29 16:09 ` [PATCH] block: missing module_put in put_disk Al Viro
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=1288367495-2919-1-git-send-email-chun@gmail.com \
--to=chun.wu84@gmail.com \
--cc=axboe@kernel.dk \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.