Skip to content

Commit

Permalink
[GENETLINK]: Relax dances with genl_lock.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Feb 13, 2008
1 parent 4c3a0a2 commit 910d6c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/netlink/genetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,8 @@ static void genl_unregister_mc_groups(struct genl_family *family)
{
struct genl_multicast_group *grp, *tmp;

genl_lock();
list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list)
__genl_unregister_mc_group(family, grp);
genl_unlock();
}

/**
Expand Down Expand Up @@ -396,10 +394,10 @@ int genl_unregister_family(struct genl_family *family)
{
struct genl_family *rc;

genl_unregister_mc_groups(family);

genl_lock();

genl_unregister_mc_groups(family);

list_for_each_entry(rc, genl_family_chain(family->id), family_list) {
if (family->id != rc->id || strcmp(rc->name, family->name))
continue;
Expand Down

0 comments on commit 910d6c3

Please sign in to comment.