summaryrefslogtreecommitdiffstats
path: root/net/netlink/genetlink.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-01-13 10:28:06 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-13 10:28:06 -0500
commitb8e429a2feac623a34e21099a4a69de29b6d873e (patch)
treeafe72e73d2b092a833e5a1cf57af1c4524a117f7 /net/netlink/genetlink.c
parentf1640c3ddeec12804bc9a21feee85fc15aca95f6 (diff)
downloadlinux-b8e429a2feac623a34e21099a4a69de29b6d873e.tar.bz2
genetlink: Fix off-by-one in genl_allocate_reserve_groups()
The bug fix for adding n_groups to the computation forgot to adjust ">=" to ">" to keep the condition correct. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r--net/netlink/genetlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index d3f6b063467b..f830326b3b1d 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -185,7 +185,7 @@ static int genl_allocate_reserve_groups(int n_groups, int *first_id)
}
}
- if (id + n_groups >= mc_groups_longs * BITS_PER_LONG) {
+ if (id + n_groups > mc_groups_longs * BITS_PER_LONG) {
unsigned long new_longs = mc_groups_longs +
BITS_TO_LONGS(n_groups);
size_t nlen = new_longs * sizeof(unsigned long);