Skip to content

Commit

Permalink
SUNRPC: off by one in BUG_ON()
Browse files Browse the repository at this point in the history
The m->pool_to[] array has "maxpools" number of elements.  It's
allocated in svc_pool_map_alloc_arrays() which we called earlier in the
function.  This test should be >= instead of >.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Dan Carpenter authored and J. Bruce Fields committed Oct 29, 2014
1 parent ccc6398 commit eb63192
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ svc_pool_map_init_percpu(struct svc_pool_map *m)
return err;

for_each_online_cpu(cpu) {
BUG_ON(pidx > maxpools);
BUG_ON(pidx >= maxpools);
m->to_pool[cpu] = pidx;
m->pool_to[pidx] = cpu;
pidx++;
Expand Down

0 comments on commit eb63192

Please sign in to comment.