diff options
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r-- | net/netlink/genetlink.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 66f6ba0bab11..566941e03363 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -176,9 +176,10 @@ int genl_register_mc_group(struct genl_family *family, | |||
176 | if (family->netnsok) { | 176 | if (family->netnsok) { |
177 | struct net *net; | 177 | struct net *net; |
178 | 178 | ||
179 | netlink_table_grab(); | ||
179 | rcu_read_lock(); | 180 | rcu_read_lock(); |
180 | for_each_net_rcu(net) { | 181 | for_each_net_rcu(net) { |
181 | err = netlink_change_ngroups(net->genl_sock, | 182 | err = __netlink_change_ngroups(net->genl_sock, |
182 | mc_groups_longs * BITS_PER_LONG); | 183 | mc_groups_longs * BITS_PER_LONG); |
183 | if (err) { | 184 | if (err) { |
184 | /* | 185 | /* |
@@ -188,10 +189,12 @@ int genl_register_mc_group(struct genl_family *family, | |||
188 | * increased on some sockets which is ok. | 189 | * increased on some sockets which is ok. |
189 | */ | 190 | */ |
190 | rcu_read_unlock(); | 191 | rcu_read_unlock(); |
192 | netlink_table_ungrab(); | ||
191 | goto out; | 193 | goto out; |
192 | } | 194 | } |
193 | } | 195 | } |
194 | rcu_read_unlock(); | 196 | rcu_read_unlock(); |
197 | netlink_table_ungrab(); | ||
195 | } else { | 198 | } else { |
196 | err = netlink_change_ngroups(init_net.genl_sock, | 199 | err = netlink_change_ngroups(init_net.genl_sock, |
197 | mc_groups_longs * BITS_PER_LONG); | 200 | mc_groups_longs * BITS_PER_LONG); |