]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitf9f5f0db29674d861f002cc81a8dc21158ea7818
tree8b36af44cc26927ae2ee15de150685ece3fe94cc
parent1ba8fc549ba69ad2e045a9b0d69f1e5d92c293a0
clk: ti: Fix error handling in ti_clk_parse_divider_data()

BugLink: https://bugs.launchpad.net/bugs/1837813
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/clk/ti/divider.c