X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=net%2Fnetlink%2Fgenetlink.c;h=f830326b3b1dbaf63e727e7a4f4f496d5108db64;hb=1b8ee1ec413bce16b0fc0e43816588c288fdc229;hp=8e63662c6fb0fc236da90883ff34b79d05308fcc;hpb=747a9b0a08ae300b99b8aa7861bd3609f3b3e782;p=cascardo%2Flinux.git diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 8e63662c6fb0..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 >= 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);