From: Dan Carpenter Date: Wed, 29 Oct 2014 08:44:16 +0000 (+0300) Subject: SUNRPC: off by one in BUG_ON() X-Git-Tag: v3.19-rc1~55^2~28 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=eb63192bb8cc0186265aad4f79fa4fd49c22b021;p=~emulex%2Finfiniband.git SUNRPC: off by one in BUG_ON() 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 Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index ca8a7958f4e..349c98f9818 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -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++;