From: Pavel Emelyanov Date: Wed, 13 Feb 2008 06:16:33 +0000 (-0800) Subject: [GENETLINK]: Relax dances with genl_lock. X-Git-Tag: MMI-PSA29.97-13-9~36262^2~80 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=910d6c320cac65c81d66e8fd30dca167092722eb;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [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 Signed-off-by: David S. Miller --- 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) { 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(); } /** @@ -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;