projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1640c3
)
genetlink: Fix off-by-one in genl_allocate_reserve_groups()
author
David S. Miller
<davem@davemloft.net>
Wed, 13 Jan 2016 15:28:06 +0000
(10:28 -0500)
committer
David S. Miller
<davem@davemloft.net>
Wed, 13 Jan 2016 15:28:06 +0000
(10:28 -0500)
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>
net/netlink/genetlink.c
patch
|
blob
|
history
diff --git
a/net/netlink/genetlink.c
b/net/netlink/genetlink.c
index d3f6b063467ba94d480230e2512ce2074d04125f..f830326b3b1dbaf63e727e7a4f4f496d5108db64 100644
(file)
--- 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);