Skip to content

Commit

Permalink
clk-gate: fix bit # check in clk_register_gate()
Browse files Browse the repository at this point in the history
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: 0457799 ("clk: gate: add CLK_GATE_HIWORD_MASK")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
  • Loading branch information
Sergei Shtylyov authored and Michael Turquette committed Jan 20, 2015
1 parent 66619ac commit 2e9dcda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/clk-gate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2e9dcda

Please sign in to comment.