fix refrigerator() vs thaw_process() race
[powerpc.git] / kernel / params.c
index e265b13..3121723 100644 (file)
@@ -356,6 +356,10 @@ int param_set_copystring(const char *val, struct kernel_param *kp)
 {
        struct kparam_string *kps = kp->arg;
 
+       if (!val) {
+               printk(KERN_ERR "%s: missing param set value\n", kp->name);
+               return -EINVAL;
+       }
        if (strlen(val)+1 > kps->maxlen) {
                printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
                       kp->name, kps->maxlen-1);
@@ -687,6 +691,7 @@ static struct kset_uevent_ops module_uevent_ops = {
 };
 
 decl_subsys(module, &module_ktype, &module_uevent_ops);
+int module_sysfs_initialized;
 
 static struct kobj_type module_ktype = {
        .sysfs_ops =    &module_sysfs_ops,
@@ -705,6 +710,7 @@ static int __init param_sysfs_init(void)
                        __FILE__, __LINE__, ret);
                return ret;
        }
+       module_sysfs_initialized = 1;
 
        param_sysfs_builtin();