[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151119193408.GA24110@mwanda>
Date: Thu, 19 Nov 2015 22:34:09 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: Josh Triplett <josh@...htriplett.org>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch -next] rcu: off by one in gp_state_getname()
It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().
Fixes: 6231da675578 ('rcu: Print symbolic name for ->gp_state')
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 6a5e1c4..6559b3c 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1203,7 +1203,7 @@ static void record_gp_stall_check_time(struct rcu_state *rsp)
*/
static char *gp_state_getname(short gs)
{
- if (gs < 0 || gs > ARRAY_SIZE(gp_state_names))
+ if (gs < 0 || gs >= ARRAY_SIZE(gp_state_names))
return "???";
return gp_state_names[gs];
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists