MIPS: BCM63xx: Add check for NULL for clk in clk_enable
authorAnastasia Belova <abelova@astralinux.ru>
Fri, 9 Dec 2022 10:05:50 +0000 (13:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:05 +0000 (13:14 +0100)
commit5e6d37a93a3820e596df8f975bc8c6b394474bd4
tree4318ce78fd00a9f647b77e7962424bef18d0a031
parent50af0ba3e163f71348c6a2e7f3a3e244efa76c53
MIPS: BCM63xx: Add check for NULL for clk in clk_enable

[ Upstream commit ee9ef11bd2a59c2fefaa0959e5efcdf040d7c654 ]

Check clk for NULL before calling clk_enable_unlocked where clk
is dereferenced. There is such check in other implementations
of clk_enable.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/bcm63xx/clk.c