sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, March 8, 2010 - 1:59 pm

Gitweb:     http://git.kernel.org/linus/361795b1eb7c08e9e65a2ebb4a4e536294d378a2
Commit:     361795b1eb7c08e9e65a2ebb4a4e536294d378a2
Parent:     35960258ed388cdcebdb71df35fd5126978ca325
Author:     Eric W. Biederman <ebiederm@xmission.com>
AuthorDate: Fri Feb 12 13:41:56 2010 -0800
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Sun Mar 7 17:04:51 2010 -0800

    sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
    
    A little more whack-a-mole annotating the dynamic sysfs attributes.  I
    had everything built into my earlier test kernel, and so I missed
    these.
    
    Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 kernel/module.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index e5538d5..c968d36 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1085,6 +1085,7 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
 		if (sattr->name == NULL)
 			goto out;
 		sect_attrs->nsections++;
+		sysfs_attr_init(&sattr->mattr.attr);
 		sattr->mattr.show = module_sect_show;
 		sattr->mattr.store = NULL;
 		sattr->mattr.attr.name = sattr->name;
@@ -1180,6 +1181,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect,
 		if (sect_empty(&sechdrs[i]))
 			continue;
 		if (sechdrs[i].sh_type == SHT_NOTE) {
+			sysfs_bin_attr_init(nattr);
 			nattr->attr.name = mod->sect_attrs->attrs[loaded].name;
 			nattr->attr.mode = S_IRUGO;
 			nattr->size = sechdrs[i].sh_size;
@@ -1252,6 +1254,7 @@ int module_add_modinfo_attrs(struct module *mod)
 		if (!attr->test ||
 		    (attr->test && attr->test(mod))) {
 			memcpy(temp_attr, attr, sizeof(*temp_attr));
+			sysfs_attr_init(&temp_attr->attr);
 			error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr);
 			++temp_attr;
 		}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on modu ..., Linux Kernel Mailing ..., (Mon Mar 8, 1:59 pm)