From: Sergei Shtylyov Date: Wed, 24 Dec 2014 14:43:27 +0000 (+0300) Subject: clk-gate: fix bit # check in clk_register_gate() X-Git-Tag: v3.16.35~2678 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e99423f75f8ce7c7cadffead156977c32de44f14;p=thirdparty%2Fkernel%2Fstable.git clk-gate: fix bit # check in clk_register_gate() commit 2e9dcdae4068460c45a308dd891be5248260251c upstream. In case CLK_GATE_HIWORD_MASK flag is passed to clk_register_gate(), the bit # should be no higher than 15, however the corresponding check is obviously off- by-one. Fixes: 045779942c04 ("clk: gate: add CLK_GATE_HIWORD_MASK") Signed-off-by: Sergei Shtylyov Signed-off-by: Michael Turquette Signed-off-by: Luis Henriques --- diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index 4a58c55255bd8..797bab97cea65 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -128,7 +128,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name, struct clk_init_data init; if (clk_gate_flags & CLK_GATE_HIWORD_MASK) { - if (bit_idx > 16) { + if (bit_idx > 15) { pr_err("gate bit exceeds LOWORD field\n"); return ERR_PTR(-EINVAL); }