diff options
author | Tero Kristo <t-kristo@ti.com> | 2015-02-23 21:06:08 +0200 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2015-03-24 20:23:36 +0200 |
commit | c807dbedb5e5adbd4e1e2d07574d230df924a5a7 (patch) | |
tree | a1479d6552f50ed68c66a25cc4860b8f68c21bfa /drivers/clk/ti/autoidle.c | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
download | linux-c807dbedb5e5adbd4e1e2d07574d230df924a5a7.tar.bz2 |
clk: ti: fix ti_clk_get_reg_addr error handling
There is a case where NULL can be a valid return value for
ti_clk_get_reg_addr, specifically the case where both the provider index
and register offsets are zero. In this case, the current error checking
against a NULL pointer will fail. Thus, change the API to return a
ERR_PTR value in an error case, and change all the users of this API to
check against IS_ERR instead.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Michael Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/ti/autoidle.c')
-rw-r--r-- | drivers/clk/ti/autoidle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/ti/autoidle.c b/drivers/clk/ti/autoidle.c index 8912ff80af34..e75c64c9e81c 100644 --- a/drivers/clk/ti/autoidle.c +++ b/drivers/clk/ti/autoidle.c @@ -119,7 +119,7 @@ int __init of_ti_clk_autoidle_setup(struct device_node *node) clk->name = node->name; clk->reg = ti_clk_get_reg_addr(node, 0); - if (!clk->reg) { + if (IS_ERR(clk->reg)) { kfree(clk); return -EINVAL; } |