]> asedeno.scripts.mit.edu Git - linux.git/commit
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)
committerStephen Boyd <sboyd@kernel.org>
Thu, 24 Jan 2019 19:23:32 +0000 (11:23 -0800)
commit303aef8b84272d73999a3207dd05bbe10ed89dc5
tree1fe00e13f1110eab24421a9bd156d17528076df3
parenta64a9c088b75cba5840320d57e0bbfb36739c3b5
clk: ti: Fix error handling in ti_clk_parse_divider_data()

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>
drivers/clk/ti/divider.c