aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-02-13 01:16:33 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-13 01:16:33 -0500
commit910d6c320cac65c81d66e8fd30dca167092722eb (patch)
tree8c15459ad21e293081636c535945682a079d51cf /net/netlink
parent4c3a0a254e5d706d3fe01bf42261534858d05586 (diff)
[GENETLINK]: Relax dances with genl_lock.
The genl_unregister_family() calls the genl_unregister_mc_groups(), which takes and releases the genl_lock and then locks and releases this lock itself. Relax this behavior, all the more so the genl_unregister_mc_groups() is called from genl_unregister_family() only. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/genetlink.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index 150579a21469..d16929c9b4bc 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -230,10 +230,8 @@ static void genl_unregister_mc_groups(struct genl_family *family)
230{ 230{
231 struct genl_multicast_group *grp, *tmp; 231 struct genl_multicast_group *grp, *tmp;
232 232
233 genl_lock();
234 list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list) 233 list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list)
235 __genl_unregister_mc_group(family, grp); 234 __genl_unregister_mc_group(family, grp);
236 genl_unlock();
237} 235}
238 236
239/** 237/**
@@ -396,10 +394,10 @@ int genl_unregister_family(struct genl_family *family)
396{ 394{
397 struct genl_family *rc; 395 struct genl_family *rc;
398 396
399 genl_unregister_mc_groups(family);
400
401 genl_lock(); 397 genl_lock();
402 398
399 genl_unregister_mc_groups(family);
400
403 list_for_each_entry(rc, genl_family_chain(family->id), family_list) { 401 list_for_each_entry(rc, genl_family_chain(family->id), family_list) {
404 if (family->id != rc->id || strcmp(rc->name, family->name)) 402 if (family->id != rc->id || strcmp(rc->name, family->name))
405 continue; 403 continue;