clk: ti: Fix error handling in ti_clk_parse_divider_data()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 15 Jan 2019 19:46:25 +0000 (22:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:02:27 +0000 (14:02 -0700)
commitcf872189c804dce1eb104643c7eec173b3933227
treefca3bcbb611bc229792e3a8cfd475ee60d1b553b
parenta038ed686aa6a504114e55f5b2c5493cdfefe2bf
clk: ti: Fix error handling in ti_clk_parse_divider_data()

[ Upstream commit 303aef8b84272d73999a3207dd05bbe10ed89dc5 ]

The ti_clk_parse_divider_data() function is only called from
_get_div_table_from_setup().  That function doesn't look at the return
value but instead looks at the "*table" pointer.  In this case, if the
kcalloc() fails then *table is NULL (which means success).  It should
instead be an error pointer.

The ti_clk_parse_divider_data() function has two callers.  One checks
for errors and the other doesn't.  I have fixed it so now both handle
errors.

Fixes: 4f6be5655dc9 ("clk: ti: divider: add driver internal API for parsing divider data")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/ti/divider.c