diff options
| author | Ingo Molnar <mingo@kernel.org> | 2013-12-17 09:27:08 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2013-12-17 09:27:08 -0500 |
| commit | bb799d3b980eb803ca2da4a4eefbd9308f8d988a (patch) | |
| tree | 69fbe0cd6d47b23a50f5e1d87bf7489532fae149 /include/net/genetlink.h | |
| parent | 919fc6e34831d1c2b58bfb5ae261dc3facc9b269 (diff) | |
| parent | 319e2e3f63c348a9b66db4667efa73178e18b17d (diff) | |
Merge tag 'v3.13-rc4' into core/locking
Merge Linux 3.13-rc4, to refresh this rather old tree with the latest fixes.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/net/genetlink.h')
| -rw-r--r-- | include/net/genetlink.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index ace4abf118d7..1b177ed803b7 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 | } |
| @@ -387,6 +384,9 @@ static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags) | |||
| 387 | static inline int genl_set_err(struct genl_family *family, struct net *net, | 384 | static inline int genl_set_err(struct genl_family *family, struct net *net, |
| 388 | u32 portid, u32 group, int code) | 385 | u32 portid, u32 group, int code) |
| 389 | { | 386 | { |
| 387 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) | ||
| 388 | return -EINVAL; | ||
| 389 | group = family->mcgrp_offset + group; | ||
| 390 | return netlink_set_err(net->genl_sock, portid, group, code); | 390 | return netlink_set_err(net->genl_sock, portid, group, code); |
| 391 | } | 391 | } |
| 392 | 392 | ||
