diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-11-21 12:20:28 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-21 13:09:43 -0500 |
commit | 91398a0992c8aa18eb7749060b75761ece5ddc57 (patch) | |
tree | 4e776ab54477ad1becb6c404805dab8db723729a /include | |
parent | 220815a9665f7deca98a09ecca655044f94cfa44 (diff) |
genetlink: fix genl_set_err() group ID
Fix another really stupid bug - I introduced genl_set_err()
precisely to be able to adjust the group and reject invalid
ones, but then forgot to do so.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/genetlink.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 771af09e90eb..1b177ed803b7 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -384,6 +384,9 @@ static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags) | |||
384 | 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, |
385 | u32 portid, u32 group, int code) | 385 | u32 portid, u32 group, int code) |
386 | { | 386 | { |
387 | if (WARN_ON_ONCE(group >= family->n_mcgrps)) | ||
388 | return -EINVAL; | ||
389 | group = family->mcgrp_offset + group; | ||
387 | return netlink_set_err(net->genl_sock, portid, group, code); | 390 | return netlink_set_err(net->genl_sock, portid, group, code); |
388 | } | 391 | } |
389 | 392 | ||