diff mbox

[2/3] clk: sunxi: factors: clear variables before using them

Message ID 1379725392-30202-3-git-send-email-emilio@elopez.com.ar
State New
Headers show

Commit Message

Emilio López Sept. 21, 2013, 1:03 a.m. UTC
Random bits may get into our factors if we don't clear n, k, m and p.

Signed-off-by: Emilio López <emilio@elopez.com.ar>
---
 drivers/clk/sunxi/clk-factors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Ripard Sept. 23, 2013, 4:57 p.m. UTC | #1
On Fri, Sep 20, 2013 at 10:03:11PM -0300, Emilio López wrote:
> Random bits may get into our factors if we don't clear n, k, m and p.
> 
> Signed-off-by: Emilio López <emilio@elopez.com.ar>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime
diff mbox

Patch

diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c
index 5687ac9..f05207a 100644
--- a/drivers/clk/sunxi/clk-factors.c
+++ b/drivers/clk/sunxi/clk-factors.c
@@ -88,7 +88,7 @@  static long clk_factors_round_rate(struct clk_hw *hw, unsigned long rate,
 static int clk_factors_set_rate(struct clk_hw *hw, unsigned long rate,
 				unsigned long parent_rate)
 {
-	u8 n, k, m, p;
+	u8 n = 0, k = 0, m = 0, p = 0;
 	u32 reg;
 	struct clk_factors *factors = to_clk_factors(hw);
 	struct clk_factors_config *config = factors->config;