lkml.org 
[lkml]   [2010]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] block: missing module_put in put_disk
Date
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


\
 
 \ /
  Last update: 2010-10-29 20:23    [W:0.107 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site