summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-08-12 08:36:54 +0530
committerRalf Baechle <ralf@linux-mips.org>2016-09-13 14:13:26 +0200
commite3b23148fd8af277fd55068183ed3ce4c8f51aa5 (patch)
tree0a2ea6dbe717d0911e7366d3b286ce3cb6399828 /arch/mips
parent9395452b4aab7bc2475ef8935b4a4fb99d778d70 (diff)
downloadtalos-obmc-linux-e3b23148fd8af277fd55068183ed3ce4c8f51aa5.tar.gz
talos-obmc-linux-e3b23148fd8af277fd55068183ed3ce4c8f51aa5.zip
MIPS: ath79: Fix test for error return of clk_register_fixed_factor().
clk_register_fixed_factor returns an ERR_PTR in case of an error and should have an IS_ERR check instead of a null check. The Coccinelle semantic patch used to find this issue is as follows: @@ expression e; statement S; @@ *e = clk_register_fixed_factor(...); if (!e) S Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Cc: julia.lawall@lip6.fr Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/13894/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/ath79/clock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index 2e7378467c5c..cc3a1e33a600 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -96,7 +96,7 @@ static struct clk * __init ath79_reg_ffclk(const char *name,
struct clk *clk;
clk = clk_register_fixed_factor(NULL, name, parent_name, 0, mult, div);
- if (!clk)
+ if (IS_ERR(clk))
panic("failed to allocate %s clock structure", name);
return clk;
OpenPOWER on IntegriCloud