aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 9bd93de01f4a..015d60cfd90e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -488,8 +488,7 @@ static void free_modinfo_##field(struct module *mod) \
488 mod->field = NULL; \ 488 mod->field = NULL; \
489} \ 489} \
490static struct module_attribute modinfo_##field = { \ 490static struct module_attribute modinfo_##field = { \
491 .attr = { .name = __stringify(field), .mode = 0444, \ 491 .attr = { .name = __stringify(field), .mode = 0444 }, \
492 .owner = THIS_MODULE }, \
493 .show = show_modinfo_##field, \ 492 .show = show_modinfo_##field, \
494 .setup = setup_modinfo_##field, \ 493 .setup = setup_modinfo_##field, \
495 .test = modinfo_##field##_exists, \ 494 .test = modinfo_##field##_exists, \
@@ -793,7 +792,7 @@ static ssize_t show_refcnt(struct module_attribute *mattr,
793} 792}
794 793
795static struct module_attribute refcnt = { 794static struct module_attribute refcnt = {
796 .attr = { .name = "refcnt", .mode = 0444, .owner = THIS_MODULE }, 795 .attr = { .name = "refcnt", .mode = 0444 },
797 .show = show_refcnt, 796 .show = show_refcnt,
798}; 797};
799 798
@@ -851,7 +850,7 @@ static ssize_t show_initstate(struct module_attribute *mattr,
851} 850}
852 851
853static struct module_attribute initstate = { 852static struct module_attribute initstate = {
854 .attr = { .name = "initstate", .mode = 0444, .owner = THIS_MODULE }, 853 .attr = { .name = "initstate", .mode = 0444 },
855 .show = show_initstate, 854 .show = show_initstate,
856}; 855};
857 856
@@ -1032,7 +1031,6 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
1032 sattr->mattr.show = module_sect_show; 1031 sattr->mattr.show = module_sect_show;
1033 sattr->mattr.store = NULL; 1032 sattr->mattr.store = NULL;
1034 sattr->mattr.attr.name = sattr->name; 1033 sattr->mattr.attr.name = sattr->name;
1035 sattr->mattr.attr.owner = mod;
1036 sattr->mattr.attr.mode = S_IRUGO; 1034 sattr->mattr.attr.mode = S_IRUGO;
1037 *(gattr++) = &(sattr++)->mattr.attr; 1035 *(gattr++) = &(sattr++)->mattr.attr;
1038 } 1036 }
@@ -1090,7 +1088,6 @@ int module_add_modinfo_attrs(struct module *mod)
1090 if (!attr->test || 1088 if (!attr->test ||
1091 (attr->test && attr->test(mod))) { 1089 (attr->test && attr->test(mod))) {
1092 memcpy(temp_attr, attr, sizeof(*temp_attr)); 1090 memcpy(temp_attr, attr, sizeof(*temp_attr));
1093 temp_attr->attr.owner = mod;
1094 error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr); 1091 error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr);
1095 ++temp_attr; 1092 ++temp_attr;
1096 } 1093 }