Skip to content

Commit ee9ef11

Browse files
Anastasia Belovatsbogend
authored andcommitted
MIPS: BCM63xx: Add check for NULL for clk in clk_enable
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 <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 31495d4 commit ee9ef11

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/mips/bcm63xx/clk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ static struct clk clk_periph = {
361361
*/
362362
int clk_enable(struct clk *clk)
363363
{
364+
if (!clk)
365+
return 0;
364366
mutex_lock(&clocks_mutex);
365367
clk_enable_unlocked(clk);
366368
mutex_unlock(&clocks_mutex);

0 commit comments

Comments
 (0)