1 --- a/lib/kobject_uevent.c
2 +++ b/lib/kobject_uevent.c
3 @@ -30,7 +30,8 @@ u64 uevent_seqnum;
4 char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH;
5 static DEFINE_SPINLOCK(sequence_lock);
6 #if defined(CONFIG_NET)
7 -static struct sock *uevent_sock;
8 +struct sock *uevent_sock = NULL;
9 +EXPORT_SYMBOL_GPL(uevent_sock);
12 /* the strings here must match the enum in include/linux/kobject.h */
13 @@ -43,6 +44,18 @@ static const char *kobject_actions[] = {
14 [KOBJ_OFFLINE] = "offline",
17 +u64 uevent_next_seqnum(void)
21 + spin_lock(&sequence_lock);
22 + seq = ++uevent_seqnum;
23 + spin_unlock(&sequence_lock);
27 +EXPORT_SYMBOL_GPL(uevent_next_seqnum);
30 * kobject_action_type - translate action string to numeric type
32 @@ -202,9 +215,7 @@ int kobject_uevent_env(struct kobject *k
33 kobj->state_remove_uevent_sent = 1;
35 /* we will send an event, so request a new sequence number */
36 - spin_lock(&sequence_lock);
37 - seq = ++uevent_seqnum;
38 - spin_unlock(&sequence_lock);
39 + seq = uevent_next_seqnum();
40 retval = add_uevent_var(env, "SEQNUM=%llu", (unsigned long long)seq);