clk: tegra: bpmp: Don't crash when a clock fails to register
authorMikko Perttunen <mperttunen@nvidia.com>
Fri, 29 Jun 2018 14:38:14 +0000 (17:38 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:38:13 +0000 (08:38 +0200)
commit0eb82af7cd718652ed9e18c00352bed33c270ace
tree9030d7c1c3dae8f74bb060ac51f56c238b395ebd
parent07101e1c8435c942472114f31b03fa4d775dd4fd
clk: tegra: bpmp: Don't crash when a clock fails to register

[ Upstream commit f7b3182232c82bb9769e2d5471d702bae2972d2b ]

When registering clocks, we just skip any that fail to register
(leaving a NULL hole in the clock table). However, our of_xlate
function still tries to dereference each entry while looking for
the clock with the requested id, causing a crash if any clocks
failed to register. Add a check to of_xlate to skip any NULL
clocks.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/tegra/clk-bpmp.c