}
EXPORT_SYMBOL(genl_register_mc_group);
+static void __genl_unregister_mc_group(struct genl_family *family,
+ struct genl_multicast_group *grp)
+{
+ BUG_ON(grp->family != family);
+ netlink_clear_multicast_users(genl_sock, grp->id);
+ clear_bit(grp->id, mc_groups);
+ list_del(&grp->list);
+ genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
+ grp->id = 0;
+ grp->family = NULL;
+}
+
/**
* genl_unregister_mc_group - unregister a multicast group
*
void genl_unregister_mc_group(struct genl_family *family,
struct genl_multicast_group *grp)
{
- BUG_ON(grp->family != family);
genl_lock();
- netlink_clear_multicast_users(genl_sock, grp->id);
- clear_bit(grp->id, mc_groups);
- list_del(&grp->list);
- genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
- grp->id = 0;
- grp->family = NULL;
+ __genl_unregister_mc_group(family, grp);
genl_unlock();
}
{
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_unregister_mc_group(family, grp);
+ genl_unlock();
}
/**