pata_pdc202xx_old: Further fixups
[firefly-linux-kernel-4.4.55.git] / kernel / params.c
index 16f269e9ddc9b7d4ed129f98f0deac4965b87507..7686417ee00eba070b7d9b5c9dd293f9991199f1 100644 (file)
@@ -592,19 +592,16 @@ static void __init param_sysfs_builtin(void)
 
        for (i=0; i < __stop___param - __start___param; i++) {
                char *dot;
-               size_t kplen;
+               size_t max_name_len;
 
                kp = &__start___param[i];
-               kplen = strlen(kp->name);
+               max_name_len =
+                       min_t(size_t, MAX_KBUILD_MODNAME, strlen(kp->name));
 
-               /* We do not handle args without periods. */
-               if (kplen > MAX_KBUILD_MODNAME) {
-                       DEBUGP("kernel parameter name is too long: %s\n", kp->name);
-                       continue;
-               }
-               dot = memchr(kp->name, '.', kplen);
+               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;
@@ -700,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,
 };
 
 /*