[PATCH] fix module sysfs files reference counting
[safe/jmp/linux-2.6] / kernel / params.c
index c76ad25..a291505 100644 (file)
@@ -638,13 +638,8 @@ static ssize_t module_attr_show(struct kobject *kobj,
        if (!attribute->show)
                return -EIO;
 
-       if (!try_module_get(mk->mod))
-               return -ENODEV;
-
        ret = attribute->show(attribute, mk->mod, buf);
 
-       module_put(mk->mod);
-
        return ret;
 }
 
@@ -662,13 +657,8 @@ static ssize_t module_attr_store(struct kobject *kobj,
        if (!attribute->store)
                return -EIO;
 
-       if (!try_module_get(mk->mod))
-               return -ENODEV;
-
        ret = attribute->store(attribute, mk->mod, buf, len);
 
-       module_put(mk->mod);
-
        return ret;
 }