Skip to content

Commit b8e429a

Browse files
committed
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>
1 parent f1640c3 commit b8e429a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netlink/genetlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int genl_allocate_reserve_groups(int n_groups, int *first_id)
185185
}
186186
}
187187

188-
if (id + n_groups >= mc_groups_longs * BITS_PER_LONG) {
188+
if (id + n_groups > mc_groups_longs * BITS_PER_LONG) {
189189
unsigned long new_longs = mc_groups_longs +
190190
BITS_TO_LONGS(n_groups);
191191
size_t nlen = new_longs * sizeof(unsigned long);

0 commit comments

Comments
 (0)