Commit c1fb1bf6 authored by Defang Bo's avatar Defang Bo Committed by Greg Ungerer

m68k: let clk_enable() return immediately if clk is NULL

Similar to commit<742859ad>("m68k: let clk_disable() return immediately if clk is NULL").
there should be a check for clk to prevent NULL pointer dereference.
Signed-off-by: default avatarDefang Bo <bodefang@126.com>
Signed-off-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
parent 92bf2261
......@@ -90,6 +90,10 @@ EXPORT_SYMBOL(clk_get);
int clk_enable(struct clk *clk)
{
unsigned long flags;
if (!clk)
return -EINVAL;
spin_lock_irqsave(&clk_lock, flags);
if ((clk->enabled++ == 0) && clk->clk_ops)
clk->clk_ops->enable(clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment