]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/params.c
Pull bugzilla-9194 into release branch
[linux-2.6-omap-h63xx.git] / kernel / params.c
index 1d6aca288cdcb078ed5a3a6790d9f532f98d8f88..7686417ee00eba070b7d9b5c9dd293f9991199f1 100644 (file)
@@ -592,13 +592,16 @@ static void __init param_sysfs_builtin(void)
 
        for (i=0; i < __stop___param - __start___param; i++) {
                char *dot;
+               size_t max_name_len;
 
                kp = &__start___param[i];
+               max_name_len =
+                       min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name));
 
-               /* We do not handle args without periods. */
-               dot = memchr(kp->name, '.', MAX_KBUILD_MODNAME);
+               dot = memchr(kp->name, '.', max_name_len);
                if (!dot) {
-                       DEBUGP("couldn't find period in %s\n", kp->name);
+                       DEBUGP("couldn't find period in first %d characters "
+                              "of %s\n", MAX_KBUILD_MODNAME, kp->name);
                        continue;
                }
                name_len = dot - kp->name;
@@ -694,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,
 };
 
 /*