diff options
author | Tero Kristo <t-kristo@ti.com> | 2015-02-23 20:06:08 +0100 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2015-03-24 19:23:36 +0100 |
commit | c807dbedb5e5adbd4e1e2d07574d230df924a5a7 (patch) | |
tree | a1479d6552f50ed68c66a25cc4860b8f68c21bfa /drivers/clk/ti/dpll.c | |
parent | Linux 4.0-rc1 (diff) | |
download | linux-c807dbedb5e5adbd4e1e2d07574d230df924a5a7.tar.xz linux-c807dbedb5e5adbd4e1e2d07574d230df924a5a7.zip |
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/dpll.c')
-rw-r--r-- | drivers/clk/ti/dpll.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c index 81dc4698dc41..11478a501c30 100644 --- a/drivers/clk/ti/dpll.c +++ b/drivers/clk/ti/dpll.c @@ -390,18 +390,18 @@ static void __init of_ti_dpll_setup(struct device_node *node, #endif } else { dd->idlest_reg = ti_clk_get_reg_addr(node, 1); - if (!dd->idlest_reg) + if (IS_ERR(dd->idlest_reg)) goto cleanup; dd->mult_div1_reg = ti_clk_get_reg_addr(node, 2); } - if (!dd->control_reg || !dd->mult_div1_reg) + if (IS_ERR(dd->control_reg) || IS_ERR(dd->mult_div1_reg)) goto cleanup; if (dd->autoidle_mask) { dd->autoidle_reg = ti_clk_get_reg_addr(node, 3); - if (!dd->autoidle_reg) + if (IS_ERR(dd->autoidle_reg)) goto cleanup; } |