diff options
author | Michael Marineau <mike@marineau.org> | 2014-04-10 17:09:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-25 15:00:49 -0400 |
commit | 86d56134f1b67d0c18025ba5cade95c048ed528d (patch) | |
tree | caa4346965954ded259784e3b68af159e3161aeb /lib/kobject_uevent.c | |
parent | d911d98748018f7c8facc035ba39c30f5cce6f9c (diff) |
kobject: Make support for uevent_helper optional.
Support for uevent_helper, aka hotplug, is not required on many systems
these days but it can still be enabled via sysfs or sysctl.
Reported-by: Darren Shepherd <darren.s.shepherd@gmail.com>
Signed-off-by: Michael Marineau <mike@marineau.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/kobject_uevent.c')
-rw-r--r-- | lib/kobject_uevent.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 4e3bd71bd949..9ebf9e20de53 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c | |||
@@ -29,7 +29,9 @@ | |||
29 | 29 | ||
30 | 30 | ||
31 | u64 uevent_seqnum; | 31 | u64 uevent_seqnum; |
32 | #ifdef CONFIG_UEVENT_HELPER | ||
32 | char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH; | 33 | char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH; |
34 | #endif | ||
33 | #ifdef CONFIG_NET | 35 | #ifdef CONFIG_NET |
34 | struct uevent_sock { | 36 | struct uevent_sock { |
35 | struct list_head list; | 37 | struct list_head list; |
@@ -109,6 +111,7 @@ static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data) | |||
109 | } | 111 | } |
110 | #endif | 112 | #endif |
111 | 113 | ||
114 | #ifdef CONFIG_UEVENT_HELPER | ||
112 | static int kobj_usermode_filter(struct kobject *kobj) | 115 | static int kobj_usermode_filter(struct kobject *kobj) |
113 | { | 116 | { |
114 | const struct kobj_ns_type_operations *ops; | 117 | const struct kobj_ns_type_operations *ops; |
@@ -147,6 +150,7 @@ static void cleanup_uevent_env(struct subprocess_info *info) | |||
147 | { | 150 | { |
148 | kfree(info->data); | 151 | kfree(info->data); |
149 | } | 152 | } |
153 | #endif | ||
150 | 154 | ||
151 | /** | 155 | /** |
152 | * kobject_uevent_env - send an uevent with environmental data | 156 | * kobject_uevent_env - send an uevent with environmental data |
@@ -323,6 +327,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | |||
323 | #endif | 327 | #endif |
324 | mutex_unlock(&uevent_sock_mutex); | 328 | mutex_unlock(&uevent_sock_mutex); |
325 | 329 | ||
330 | #ifdef CONFIG_UEVENT_HELPER | ||
326 | /* call uevent_helper, usually only enabled during early boot */ | 331 | /* call uevent_helper, usually only enabled during early boot */ |
327 | if (uevent_helper[0] && !kobj_usermode_filter(kobj)) { | 332 | if (uevent_helper[0] && !kobj_usermode_filter(kobj)) { |
328 | struct subprocess_info *info; | 333 | struct subprocess_info *info; |
@@ -347,6 +352,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | |||
347 | env = NULL; /* freed by cleanup_uevent_env */ | 352 | env = NULL; /* freed by cleanup_uevent_env */ |
348 | } | 353 | } |
349 | } | 354 | } |
355 | #endif | ||
350 | 356 | ||
351 | exit: | 357 | exit: |
352 | kfree(devpath); | 358 | kfree(devpath); |