Skip to content

Commit

Permalink
MIPS: BCM63xx: Add check for NULL for clk in clk_enable
Browse files Browse the repository at this point in the history
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: e7300d0 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
  • Loading branch information
Anastasia Belova authored and intel-lab-lkp committed Nov 25, 2022
1 parent 08ad43d commit 881e6b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/mips/bcm63xx/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ static struct clk clk_periph = {
*/
int clk_enable(struct clk *clk)
{
if (!clk)
return;

mutex_lock(&clocks_mutex);
clk_enable_unlocked(clk);
mutex_unlock(&clocks_mutex);
Expand Down

0 comments on commit 881e6b8

Please sign in to comment.