summaryrefslogtreecommitdiff
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 02:16:33 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 02:16:33 (GMT)
commit020f46a39eb7b99a575b9f4d105fce2b142acdf1 (patch)
tree6abb47cdded94553adb31234bb277b8b5212873e /net/netlink/af_netlink.c
parent41b6c37326cb24efc86fba94bcaa37f2cc23f1cd (diff)
parent4da62fc70d7cbcf8fa606a8c806d9dc8faa0ceae (diff)
downloadlinux-020f46a39eb7b99a575b9f4d105fce2b142acdf1.tar.xz
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r--net/netlink/af_netlink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 70bcd47..fc456a7 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -315,8 +315,8 @@ err:
static void netlink_remove(struct sock *sk)
{
netlink_table_grab();
- nl_table[sk->sk_protocol].hash.entries--;
- sk_del_node_init(sk);
+ if (sk_del_node_init(sk))
+ nl_table[sk->sk_protocol].hash.entries--;
if (nlk_sk(sk)->groups)
__sk_del_bind_node(sk);
netlink_table_ungrab();
@@ -429,7 +429,12 @@ retry:
err = netlink_insert(sk, pid);
if (err == -EADDRINUSE)
goto retry;
- return 0;
+
+ /* If 2 threads race to autobind, that is fine. */
+ if (err == -EBUSY)
+ err = 0;
+
+ return err;
}
static inline int netlink_capable(struct socket *sock, unsigned int flag)