From c842128607a50a670df5f9c75261db2e21db3c45 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 21 May 2010 15:05:21 -0700 Subject: lib/kobject_uevent.c: fix CONIG_NET=n warning lib/kobject_uevent.c:87: warning: 'kobj_bcast_filter' defined but not used Repairs "hotplug: netns aware uevent_helper" Cc: Eric W. Biederman Cc: David S. Miller Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- lib/kobject_uevent.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 59c15511d58a..e2eb989d3223 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -83,6 +83,7 @@ out: return ret; } +#ifdef CONFIG_NET static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data) { struct kobject *kobj = data; @@ -98,6 +99,7 @@ static int kobj_bcast_filter(struct sock *dsk, struct sk_buff *skb, void *data) return 0; } +#endif static int kobj_usermode_filter(struct kobject *kobj) { -- cgit v1.2.3-58-ga151 From 743db2d903bc4e963a31496328d847d69f75047c Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 25 May 2010 11:51:10 +0200 Subject: kobject: free memory if netlink_kernel_create() fails There is a kfree(ue_sk) missing on the error path if netlink_kernel_create() fails. Signed-off-by: Dan Carpenter Reviewed-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman --- lib/kobject_uevent.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index e2eb989d3223..b93579504dfa 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -380,6 +380,7 @@ static int uevent_net_init(struct net *net) if (!ue_sk->sk) { printk(KERN_ERR "kobject_uevent: unable to create netlink socket!\n"); + kfree(ue_sk); return -ENODEV; } mutex_lock(&uevent_sock_mutex); -- cgit v1.2.3-58-ga151