diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/genetlink.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index ace4abf118d7..771af09e90eb 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -265,7 +265,7 @@ static inline int genlmsg_multicast_netns(struct genl_family *family, | |||
265 | struct net *net, struct sk_buff *skb, | 265 | struct net *net, struct sk_buff *skb, |
266 | u32 portid, unsigned int group, gfp_t flags) | 266 | u32 portid, unsigned int group, gfp_t flags) |
267 | { | 267 | { |
268 | if (group >= family->n_mcgrps) | 268 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) |
269 | return -EINVAL; | 269 | return -EINVAL; |
270 | group = family->mcgrp_offset + group; | 270 | group = family->mcgrp_offset + group; |
271 | return nlmsg_multicast(net->genl_sock, skb, portid, group, flags); | 271 | return nlmsg_multicast(net->genl_sock, skb, portid, group, flags); |
@@ -283,9 +283,6 @@ static inline int genlmsg_multicast(struct genl_family *family, | |||
283 | struct sk_buff *skb, u32 portid, | 283 | struct sk_buff *skb, u32 portid, |
284 | unsigned int group, gfp_t flags) | 284 | unsigned int group, gfp_t flags) |
285 | { | 285 | { |
286 | if (group >= family->n_mcgrps) | ||
287 | return -EINVAL; | ||
288 | group = family->mcgrp_offset + group; | ||
289 | return genlmsg_multicast_netns(family, &init_net, skb, | 286 | return genlmsg_multicast_netns(family, &init_net, skb, |
290 | portid, group, flags); | 287 | portid, group, flags); |
291 | } | 288 | } |