Commit 7371f3e1 authored by Robert Love's avatar Robert Love Committed by Greg Kroah-Hartman

[PATCH] kobject_uevent: fix init ordering

Looks like kobject_uevent_init is executed before netlink_proto_init and
consequently always fails.  Not cool.

Attached patch switches the initialization over from core_initcall (init
level 1) to postcore_initcall (init level 2).  Netlink's initialization
is done in core_initcall, so this should fix the problem.  We should be
fine waiting until postcore_initcall.

Also a couple white space changes mixed in, because I am anal.
Signed-Off-By: default avatarRobert Love <rml@novell.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 07b8bb0f
...@@ -120,9 +120,8 @@ static int do_kobject_uevent(struct kobject *kobj, enum kobject_action action, ...@@ -120,9 +120,8 @@ static int do_kobject_uevent(struct kobject *kobj, enum kobject_action action,
sprintf(attrpath, "%s/%s", path, attr->name); sprintf(attrpath, "%s/%s", path, attr->name);
rc = send_uevent(signal, attrpath, NULL, gfp_mask); rc = send_uevent(signal, attrpath, NULL, gfp_mask);
kfree(attrpath); kfree(attrpath);
} else { } else
rc = send_uevent(signal, path, NULL, gfp_mask); rc = send_uevent(signal, path, NULL, gfp_mask);
}
exit: exit:
kfree(path); kfree(path);
...@@ -148,7 +147,6 @@ int kobject_uevent_atomic(struct kobject *kobj, enum kobject_action action, ...@@ -148,7 +147,6 @@ int kobject_uevent_atomic(struct kobject *kobj, enum kobject_action action,
{ {
return do_kobject_uevent(kobj, action, attr, GFP_ATOMIC); return do_kobject_uevent(kobj, action, attr, GFP_ATOMIC);
} }
EXPORT_SYMBOL_GPL(kobject_uevent_atomic); EXPORT_SYMBOL_GPL(kobject_uevent_atomic);
static int __init kobject_uevent_init(void) static int __init kobject_uevent_init(void)
...@@ -164,7 +162,7 @@ static int __init kobject_uevent_init(void) ...@@ -164,7 +162,7 @@ static int __init kobject_uevent_init(void)
return 0; return 0;
} }
core_initcall(kobject_uevent_init); postcore_initcall(kobject_uevent_init);
#else #else
static inline int send_uevent(const char *signal, const char *obj, static inline int send_uevent(const char *signal, const char *obj,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment