]> Git Repo - linux.git/commitdiff
MIPS: BCM63xx: Add check for NULL for clk in clk_enable
authorAnastasia Belova <[email protected]>
Fri, 9 Dec 2022 10:05:50 +0000 (13:05 +0300)
committerThomas Bogendoerfer <[email protected]>
Fri, 9 Dec 2022 22:37:06 +0000 (23:37 +0100)
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 <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
arch/mips/bcm63xx/clk.c

index 6e6756e8fa0a92be1ecc0a99d4b1554363af2710..86a6e25908664b59dafae3ca2297f70e296220c9 100644 (file)
@@ -361,6 +361,8 @@ static struct clk clk_periph = {
  */
 int clk_enable(struct clk *clk)
 {
+       if (!clk)
+               return 0;
        mutex_lock(&clocks_mutex);
        clk_enable_unlocked(clk);
        mutex_unlock(&clocks_mutex);
This page took 0.055191 seconds and 4 git commands to generate.