From: Christophe JAILLET Date: Sun, 25 Sep 2016 11:53:58 +0000 (+0200) Subject: clk: at91: Fix a return value in case of error X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=91bbc174d45c347aa7aedb2215cc7d2013c06c1f;p=openwrt%2Fstaging%2Fblogic.git clk: at91: Fix a return value in case of error If 'clk_hw_register()' fails, it is likely that we expect to return an error instead of a valid pointer (which would mean success). Fix commit f5644f10dcfb ("clk: at91: Migrate to clk_hw based registration and OF APIs") Signed-off-by: Christophe JAILLET Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index 190122e64a3a..85a449cf61e3 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c @@ -203,7 +203,7 @@ at91_clk_register_programmable(struct regmap *regmap, ret = clk_hw_register(NULL, &prog->hw); if (ret) { kfree(prog); - hw = &prog->hw; + hw = ERR_PTR(ret); } return hw;