Skip to contentSkip to conversation

driver core fix for 2.6.24-rc6

PATCH New Greg KH 1 participant 3 messages Dec 23, 2007

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 driver core fix for 2.6.24-rc6

Here is one bugfix for a memory leak for every module that is unloaded from the system due to the change in the kobject name code against your 2.6.24-rc6 tree.

And an entry for MAINTAINERS for the UIO subsystem so the proper people get the blame :)

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/

Patches will be sent as a follow-on to this message to lkml for people to see.

thanks,

greg k-h

------------

 MAINTAINERS     |    8 ++++++++
 kernel/params.c |   10 ++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

---------------

Greg Kroah-Hartman (1):
Modules: fix memory leak of module names

Hans-Jürgen Koch (1):
UIO: Add a MAINTAINERS entry for Userspace I/O

#1 lore raw

PATCH 1/2 UIO: Add a MAINTAINERS entry for Userspace I/O

From: Hans-Jürgen Koch <[email protected]>

This patch adds an entry for the Userspace I/O framework to MAINTAINERS.

---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
MAINTAINERS +8 -0
index 3c7db62..a06ee43 100644
@@ -4054,6 +4054,14 @@ L:	[email protected]
 W:	http://user-mode-linux.sourceforge.net
 S:	Maintained
 
+USERSPACE I/O (UIO)
+P:	Hans J. Koch
+M:	[email protected]
+P:	Greg Kroah-Hartman
+M:	[email protected]
+L:	[email protected]
+S:	Maintained
+
 FAT/VFAT/MSDOS FILESYSTEM:
 P:	OGAWA Hirofumi
 M:	[email protected]
Signature · 1 line
1.5.3.7
#2 lore raw

PATCH 2/2 Modules: fix memory leak of module names

In reply to Greg KH

Due to the change in kobject name handling, the module kobject needs to have a null release function to ensure that the name it previously set will be properly cleaned up.

All of this wierdness goes away in 2.6.25 with the rework of the kobject name and cleanup logic, but this is required for 2.6.24.

Thanks to Alexey Dobriyan for finding the problem, and to Kay Sievers for pointing out the simple way to fix it after I tried many complex ways.

Cc Alexey Dobriyan <[email protected]>
Cc Kay Sievers <[email protected]>
---
 kernel/params.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
kernel/params.c +10 -0
index 2a4c514..7686417 100644
@@ -697,8 +697,18 @@ static struct kset_uevent_ops module_uevent_ops = {
 decl_subsys(module, &module_ktype, &module_uevent_ops);
 int module_sysfs_initialized;
 
+static void module_release(struct kobject *kobj)
+{
+	/*
+	 * Stupid empty release function to allow the memory for the kobject to
+	 * be properly cleaned up.  This will not need to be present for 2.6.25
+	 * with the upcoming kobject core rework.
+	 */
+}
+
 static struct kobj_type module_ktype = {
 	.sysfs_ops =	&module_sysfs_ops,
+	.release =	module_release,
 };
 
 /*
Signature · 1 line
1.5.3.7