Skip to content

Commit f743ca5

Browse files
akpm@osdl.orggregkh
authored andcommitted
[PATCH] kobject_uevent CONFIG_NET=n fix
lib/lib.a(kobject_uevent.o)(.text+0x25f): In function `kobject_uevent': : undefined reference to `__alloc_skb' lib/lib.a(kobject_uevent.o)(.text+0x2a1): In function `kobject_uevent': : undefined reference to `skb_over_panic' lib/lib.a(kobject_uevent.o)(.text+0x31d): In function `kobject_uevent': : undefined reference to `skb_over_panic' lib/lib.a(kobject_uevent.o)(.text+0x356): In function `kobject_uevent': : undefined reference to `netlink_broadcast' lib/lib.a(kobject_uevent.o)(.init.text+0x9): In function `kobject_uevent_init': : undefined reference to `netlink_kernel_create' make: *** [.tmp_vmlinux1] Error 1 Netlink is unconditionally enabled if CONFIG_NET, so that's OK. kobject_uevent.o is compiled even if !CONFIG_HOTPLUG, which is lazy. Let's compound the sin. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent d960bb4 commit f743ca5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/linux/kobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ struct subsys_attribute {
253253
extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
254254
extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
255255

256-
#ifdef CONFIG_HOTPLUG
256+
#if defined(CONFIG_HOTPLUG) & defined(CONFIG_NET)
257257
void kobject_uevent(struct kobject *kobj, enum kobject_action action);
258258

259259
int add_uevent_var(char **envp, int num_envp, int *cur_index,

kernel/ksysfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include <linux/module.h>
1616
#include <linux/init.h>
1717

18+
u64 uevent_seqnum;
19+
char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
20+
1821
#define KERNEL_ATTR_RO(_name) \
1922
static struct subsys_attribute _name##_attr = __ATTR_RO(_name)
2023

lib/kobject_uevent.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
#define BUFFER_SIZE 1024 /* buffer for the variables */
2626
#define NUM_ENVP 32 /* number of env pointers */
2727

28-
#if defined(CONFIG_HOTPLUG)
29-
char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
30-
u64 uevent_seqnum;
28+
#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
3129
static DEFINE_SPINLOCK(sequence_lock);
3230
static struct sock *uevent_sock;
3331

0 commit comments

Comments
 (0)